net.openhft.collect.hash
Interface HashContainerFactory<T extends HashContainerFactory<T>>

Type Parameters:
T - the concrete factory type which extends this interface
All Known Subinterfaces:
ByteHashFactory<T>, CharHashFactory<T>, HashByteByteMapFactory, HashByteCharMapFactory, HashByteDoubleMapFactory, HashByteFloatMapFactory, HashByteIntMapFactory, HashByteLongMapFactory, HashByteObjMapFactory<V>, HashByteSetFactory, HashByteShortMapFactory, HashCharByteMapFactory, HashCharCharMapFactory, HashCharDoubleMapFactory, HashCharFloatMapFactory, HashCharIntMapFactory, HashCharLongMapFactory, HashCharObjMapFactory<V>, HashCharSetFactory, HashCharShortMapFactory, HashDoubleByteMapFactory, HashDoubleCharMapFactory, HashDoubleDoubleMapFactory, HashDoubleFloatMapFactory, HashDoubleIntMapFactory, HashDoubleLongMapFactory, HashDoubleObjMapFactory<V>, HashDoubleSetFactory, HashDoubleShortMapFactory, HashFloatByteMapFactory, HashFloatCharMapFactory, HashFloatDoubleMapFactory, HashFloatFloatMapFactory, HashFloatIntMapFactory, HashFloatLongMapFactory, HashFloatObjMapFactory<V>, HashFloatSetFactory, HashFloatShortMapFactory, HashIntByteMapFactory, HashIntCharMapFactory, HashIntDoubleMapFactory, HashIntFloatMapFactory, HashIntIntMapFactory, HashIntLongMapFactory, HashIntObjMapFactory<V>, HashIntSetFactory, HashIntShortMapFactory, HashLongByteMapFactory, HashLongCharMapFactory, HashLongDoubleMapFactory, HashLongFloatMapFactory, HashLongIntMapFactory, HashLongLongMapFactory, HashLongObjMapFactory<V>, HashLongSetFactory, HashLongShortMapFactory, HashObjByteMapFactory<K>, HashObjCharMapFactory<K>, HashObjDoubleMapFactory<K>, HashObjFloatMapFactory<K>, HashObjIntMapFactory<K>, HashObjLongMapFactory<K>, HashObjObjMapFactory<K,V>, HashObjSetFactory<E>, HashObjShortMapFactory<K>, HashShortByteMapFactory, HashShortCharMapFactory, HashShortDoubleMapFactory, HashShortFloatMapFactory, HashShortIntMapFactory, HashShortLongMapFactory, HashShortObjMapFactory<V>, HashShortSetFactory, HashShortShortMapFactory, IntHashFactory<T>, LongHashFactory<T>, ObjHashFactory<T>, ShortHashFactory<T>

public interface HashContainerFactory<T extends HashContainerFactory<T>>

Common configuration for factories of hash containers.

Configurations from this interface, hash config and default expected size, don't affect application semantics in any way, only performance and memory footprint characteristics.

See Also:
HashContainer

Method Summary
 int getDefaultExpectedSize()
          Returns the default expected size.
 HashConfig getHashConfig()
          Returns the hash config, with which containers constructed by this factory are initialized.
 T withDefaultExpectedSize(int defaultExpectedSize)
          Returns a copy of this factory with default expected size set to the given value.
 T withHashConfig(HashConfig config)
          Returns a copy of this factory with hash config set to the given one.
 

Method Detail

getHashConfig

@Nonnull
HashConfig getHashConfig()
Returns the hash config, with which containers constructed by this factory are initialized.

Default hash config is HashConfig.getDefault().

Returns:
the hash config of this factory

withHashConfig

T withHashConfig(@Nonnull
                 HashConfig config)
Returns a copy of this factory with hash config set to the given one.

Parameters:
config - the new hash config
Returns:
a copy of this factory with hash config set to the given one

getDefaultExpectedSize

int getDefaultExpectedSize()
Returns the default expected size. This size is used to initialize hash containers in no-arg factory methods and methods that accept uncountable sources of elements: iterables, iterators, supplier functions, etc.

Default value of the default expected size is 10.

Returns:
the default expected size

withDefaultExpectedSize

T withDefaultExpectedSize(int defaultExpectedSize)
Returns a copy of this factory with default expected size set to the given value.

Parameters:
defaultExpectedSize - the new default expected size
Returns:
a copy of this factory with default expected size set to the given value
Throws:
IllegalArgumentException - if defaultExpectedSize is non-positive