public StructSet(int initialCapacity, StructType structType) { this.contents = new ObjectOpenCustomHashSet(initialCapacity, new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException( "structType must not be null"); } this.structType = structType; }
/** takes collection of Object[] fieldValues *or* another StructSet */ public StructSet(Collection c, StructType structType) { this.contents = new ObjectOpenCustomHashSet(c, new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException( "structType must not be null"); } this.structType = structType; }
public StructSet(int initialCapacity, float loadFactor, StructType structType) { this.contents = new ObjectOpenCustomHashSet(initialCapacity, loadFactor, new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException( "structType must not be null"); } this.structType = structType; }
/** Creates a new instance of StructSet */ public StructSet(StructType structType) { this.contents = new ObjectOpenCustomHashSet(new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException( "structType must not be null"); } this.structType = structType; }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.contents = new ObjectOpenCustomHashSet(new ObjectArrayHashingStrategy()); int size = in.readInt(); this.structType = (StructTypeImpl) DataSerializer.readObject(in); for (int j = size; j > 0; j--) { this.add(DataSerializer.readObject(in)); } }
/** * Creates a StructSet directly from a StructBag; (internal use) * * @since GemFire 5.1 */ StructSet(StructBag bag) { this.contents = new ObjectOpenCustomHashSet(new ObjectArrayHashingStrategy()); this.structType = (StructType) bag.elementType; if (bag.hasLimitIterator) { // Asif: Since the number of unique keys which // will be returned by Bag with limit in place // cannot be more than the size of the bag ( i.e // the limit) , we can safely assume HashMap size // to equal to bag's size Iterator itr = bag.fieldValuesIterator(); while (itr.hasNext()) { addFieldValues((Object[]) itr.next()); } } else { Set keys = bag.map.keySet(); for (Object key : keys) { addFieldValues((Object[]) key); } } }
@SuppressWarnings("unchecked") public static Set<?> toFastutilHashSet(Set<?> set, Type type, FunctionRegistry registry) { // 0.25 as the load factor is chosen because the argument set is assumed to be small (<10000), // and the return set is assumed to be read-heavy. // The performance of InCodeGenerator heavily depends on the load factor being small. Class<?> javaElementType = type.getJavaType(); if (javaElementType == long.class) { return new LongOpenCustomHashSet((Collection<Long>) set, 0.25f, new LongStrategy(registry, type)); } if (javaElementType == double.class) { return new DoubleOpenCustomHashSet((Collection<Double>) set, 0.25f, new DoubleStrategy(registry, type)); } if (javaElementType == boolean.class) { return new BooleanOpenHashSet((Collection<Boolean>) set, 0.25f); } else if (!type.getJavaType().isPrimitive()) { return new ObjectOpenCustomHashSet(set, 0.25f, new ObjectStrategy(registry, type)); } else { throw new UnsupportedOperationException("Unsupported native type in set: " + type.getJavaType() + " with type " + type.getTypeSignature()); } }
private RowSnapshotSet(Schema schema) { this.schema = schema; this.rowSet = new ObjectOpenCustomHashSet<BaseRowSnapshot>( new BaseRowSnapshotHashingStrategy(schema)); }
public StructSet(int initialCapacity, float loadFactor, StructType structType) { this.contents = new ObjectOpenCustomHashSet(initialCapacity, loadFactor, new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException(LocalizedStrings.StructSet_STRUCTTYPE_MUST_NOT_BE_NULL.toLocalizedString()); } this.structType = structType; }
/** takes collection of Object[] fieldValues *or* another StructSet */ public StructSet(Collection c, StructType structType) { this.contents = new ObjectOpenCustomHashSet(c, new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException(LocalizedStrings.StructSet_STRUCTTYPE_MUST_NOT_BE_NULL.toLocalizedString()); } this.structType = structType; }
/** Creates a new instance of StructSet */ public StructSet(StructType structType) { this.contents = new ObjectOpenCustomHashSet(new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException(LocalizedStrings.StructSet_STRUCTTYPE_MUST_NOT_BE_NULL.toLocalizedString()); } this.structType = structType; }
public StructSet(int initialCapacity, StructType structType) { this.contents = new ObjectOpenCustomHashSet(initialCapacity, new ObjectArrayHashingStrategy()); if (structType == null) { throw new IllegalArgumentException(LocalizedStrings.StructSet_STRUCTTYPE_MUST_NOT_BE_NULL.toLocalizedString()); } this.structType = structType; }
public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.contents = new ObjectOpenCustomHashSet(new ObjectArrayHashingStrategy()); int size = in.readInt(); this.structType = (StructTypeImpl)DataSerializer.readObject(in); for (int j = size; j > 0; j--) { this.add(DataSerializer.readObject(in)); } }
public Session(SocketChannel channel, OrderBooks books) { this.transport = new SoupBinTCPServer(channel, POE.MAX_INBOUND_MESSAGE_LENGTH, new POEServerParser(this), this); this.orders = new Object2ObjectOpenCustomHashMap<>(HASH_STRATEGY); this.orderIds = new ObjectOpenCustomHashSet<>(HASH_STRATEGY); this.books = books; this.terminated = false; }
/** Creates a StructSet directly from a StructBag; * (internal use) * @since 5.1 */ StructSet(StructBag bag) { this.contents = new ObjectOpenCustomHashSet(new ObjectArrayHashingStrategy()); this.structType = (StructType)bag.elementType; if (bag.hasLimitIterator) { // Asif: Since the number of unique keys which // will be returned by Bag with limit in place // cannot be more than the size of the bag ( i.e // the limit) , we can safely assume HashMap size // to equal to bag's size Iterator itr = bag.fieldValuesIterator(); while (itr.hasNext()) { addFieldValues((Object[])itr.next()); } } else { Set keys = bag.map.keySet(); for (Object key : keys) { addFieldValues((Object[])key); } } }
Set<KmerPathNode> children = new ObjectOpenCustomHashSet<KmerPathNode>(new KmerNodeUtil.HashByLastEndKmer<KmerPathNode>()); for (KmerPathNode node : nodes) { if (node == null) {
@SuppressWarnings("unchecked") public static Set<?> toFastutilHashSet(Set<?> set, Type type, FunctionRegistry registry) { // 0.25 as the load factor is chosen because the argument set is assumed to be small (<10000), // and the return set is assumed to be read-heavy. // The performance of InCodeGenerator heavily depends on the load factor being small. Class<?> javaElementType = type.getJavaType(); if (javaElementType == long.class) { return new LongOpenCustomHashSet((Collection<Long>) set, 0.25f, new LongStrategy(registry, type)); } if (javaElementType == double.class) { return new DoubleOpenCustomHashSet((Collection<Double>) set, 0.25f, new DoubleStrategy(registry, type)); } if (javaElementType == boolean.class) { return new BooleanOpenHashSet((Collection<Boolean>) set, 0.25f); } else if (!type.getJavaType().isPrimitive()) { return new ObjectOpenCustomHashSet(set, 0.25f, new ObjectStrategy(registry, type)); } else { throw new UnsupportedOperationException("Unsupported native type in set: " + type.getJavaType() + " with type " + type.getTypeSignature()); } }
@SuppressWarnings("unchecked") public static Set<?> toFastutilHashSet(Set<?> set, Type type, FunctionRegistry registry) { // 0.25 as the load factor is chosen because the argument set is assumed to be small (<10000), // and the return set is assumed to be read-heavy. // The performance of InCodeGenerator heavily depends on the load factor being small. Class<?> javaElementType = type.getJavaType(); if (javaElementType == long.class) { return new LongOpenCustomHashSet((Collection<Long>) set, 0.25f, new LongStrategy(registry, type)); } if (javaElementType == double.class) { return new DoubleOpenCustomHashSet((Collection<Double>) set, 0.25f, new DoubleStrategy(registry, type)); } if (javaElementType == boolean.class) { return new BooleanOpenHashSet((Collection<Boolean>) set, 0.25f); } else if (!type.getJavaType().isPrimitive()) { return new ObjectOpenCustomHashSet(set, 0.25f, new ObjectStrategy(registry, type)); } else { throw new UnsupportedOperationException("Unsupported native type in set: " + type.getJavaType() + " with type " + type.getTypeSignature()); } }
@SuppressWarnings({"unchecked"}) public static Set<?> toFastutilHashSet(Set<?> set, Type type, FunctionRegistry registry) { // 0.25 as the load factor is chosen because the argument set is assumed to be small (<10000), // and the return set is assumed to be read-heavy. // The performance of InCodeGenerator heavily depends on the load factor being small. Class<?> javaElementType = type.getJavaType(); if (javaElementType == long.class) { return new LongOpenCustomHashSet((Collection<Long>) set, 0.25f, new LongStrategy(registry, type)); } if (javaElementType == double.class) { return new DoubleOpenCustomHashSet((Collection<Double>) set, 0.25f, new DoubleStrategy(registry, type)); } if (javaElementType == boolean.class) { return new BooleanOpenHashSet((Collection<Boolean>) set, 0.25f); } else if (!type.getJavaType().isPrimitive()) { return new ObjectOpenCustomHashSet(set, 0.25f, new ObjectStrategy(registry, type)); } else { throw new UnsupportedOperationException("Unsupported native type in set: " + type.getJavaType() + " with type " + type.getTypeSignature()); } }