/** * For internal use. Just add the Object[] values for a struct with same type */ @Override public boolean addFieldValues(Object[] fieldValues) { return this.contents.add(fieldValues); }
public boolean addAll(StructSet ss) { boolean modified = false; if (!this.structType.equals(ss.structType)) { throw new IllegalArgumentException( "types do not match"); } for (Iterator itr = ss.fieldValuesIterator(); itr.hasNext();) { Object[] vals = (Object[]) itr.next(); if (this.contents.add(vals)) { modified = true; } } return modified; }
/** * For internal use. Just add the Object[] values for a struct with same type */ public boolean addFieldValues(Object[] fieldValues) { return this.contents.add(fieldValues); }
/** * Creates a new hash set using elements provided by a type-specific iterator. * * @param i * a type-specific iterator whose elements will fill the set. * @param f * the load factor. * @param strategy * the strategy. */ public ObjectOpenCustomHashSet(final Iterator<? extends K> i, final float f, final Strategy<? super K> strategy) { this(DEFAULT_INITIAL_SIZE, f, strategy); while (i.hasNext()) add(i.next()); } /**
public boolean addAll(StructSet ss) { boolean modified = false; if (!this.structType.equals(ss.structType)) { throw new IllegalArgumentException(LocalizedStrings.StructSet_TYPES_DONT_MATCH.toLocalizedString()); } for (Iterator itr = ss.fieldValuesIterator(); itr.hasNext();) { Object[] vals = (Object[]) itr.next(); if (this.contents.add(vals)) { modified = true; } } return modified; }
/** * Creates a new hash set and fills it with the elements of a given array. * * @param a * an array whose elements will be used to fill the set. * @param offset * the first element to use. * @param length * the number of elements to use. * @param f * the load factor. * @param strategy * the strategy. */ public ObjectOpenCustomHashSet(final K[] a, final int offset, final int length, final float f, final Strategy<? super K> strategy) { this(length < 0 ? 0 : length, f, strategy); ObjectArrays.ensureOffsetLength(a, offset, length); for (int i = 0; i < length; i++) add(a[offset + i]); } /**
public void orderAccepted(POE.EnterOrder message, Order order) { orderAccepted.timestamp = timestamp(); System.arraycopy(message.orderId, 0, orderAccepted.orderId, 0, orderAccepted.orderId.length); orderAccepted.side = message.side; orderAccepted.instrument = message.instrument; orderAccepted.quantity = message.quantity; orderAccepted.price = message.price; orderAccepted.orderNumber = order.getOrderNumber(); send(orderAccepted); orderIds.add(message.orderId.clone()); }
private void process(KmerPathNode node) { int beforeTotalWeight = 0; if (Defaults.SANITY_CHECK_ASSEMBLY_GRAPH) { beforeTotalWeight = node.width() * node.weight() + processed.stream().mapToInt(n -> n.width() * n.weight()).sum(); assert(!processed.contains(node)); } while (reduce(node)) { // loop until we can't merge any more nodes into this one simplified++; } if (Defaults.SANITY_CHECK_ASSEMBLY_GRAPH) { int afterTotalWeight = node.width() * node.weight() + processed.stream().mapToInt(n -> n.width() * n.weight()).sum(); assert(beforeTotalWeight == afterTotalWeight); assert(!processed.contains(node)); } processed.add(node); endLookup.add(node); if (Defaults.SANITY_CHECK_ASSEMBLY_GRAPH) { assert(sanityCheck()); } } /**