public abstract class TShortHash extends TPrimitiveHash implements TShortHashingStrategy
Modifier and Type | Field and Description |
---|---|
protected TShortHashingStrategy |
_hashingStrategy
strategy used to hash values in this collection
|
protected short[] |
_set
the set of shorts
|
_states, FREE, FULL, REMOVED
_autoCompactionFactor, _autoCompactRemovesRemaining, _free, _loadFactor, _maxSize, _size, DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR
Constructor and Description |
---|
TShortHash()
Creates a new
TShortHash instance with the default capacity and load factor. |
TShortHash(int initialCapacity)
Creates a new
TShortHash instance whose capacity is the next highest prime above
initialCapacity + 1 unless that value is already prime. |
TShortHash(int initialCapacity,
float loadFactor)
Creates a new
TShortHash instance with a prime value at or near the specified
capacity and load factor. |
TShortHash(int initialCapacity,
float loadFactor,
TShortHashingStrategy strategy)
Creates a new
TShortHash instance with a prime value at or near the specified
capacity and load factor. |
TShortHash(int initialCapacity,
TShortHashingStrategy strategy)
Creates a new
TShortHash instance whose capacity is the next highest prime above
initialCapacity + 1 unless that value is already prime. |
TShortHash(TShortHashingStrategy strategy)
Creates a new
TShortHash instance with the default capacity and load factor. |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
int |
computeHashCode(short val)
Default implementation of TShortHashingStrategy: delegates hashing to
HashFunctions.hash(short).
|
boolean |
contains(short val)
Searches the set for val
|
boolean |
forEach(TShortProcedure procedure)
Executes procedure for each element in the set.
|
protected int |
index(short val)
Locates the index of val.
|
protected int |
insertionIndex(short val)
Locates the index at which val can be inserted.
|
protected void |
removeAt(int index)
Releases the element currently stored at index.
|
protected int |
setUp(int initialCapacity)
initializes the hashtable to a prime capacity which is at least initialCapacity +
1.
|
capacity
calculateGrownCapacity, clear, compact, ensureCapacity, getAutoCompactionFactor, isEmpty, postInsertHook, readExternal, reenableAutoCompaction, rehash, setAutoCompactionFactor, size, tempDisableAutoCompaction, trimToSize, writeExternal
protected transient short[] _set
protected TShortHashingStrategy _hashingStrategy
public TShortHash()
TShortHash
instance with the default capacity and load factor.public TShortHash(int initialCapacity)
TShortHash
instance whose capacity is the next highest prime above
initialCapacity + 1 unless that value is already prime.initialCapacity
- an int
valuepublic TShortHash(int initialCapacity, float loadFactor)
TShortHash
instance with a prime value at or near the specified
capacity and load factor.initialCapacity
- used to find a prime capacity for the table.loadFactor
- used to calculate the threshold over which rehashing takes place.public TShortHash(TShortHashingStrategy strategy)
TShortHash
instance with the default capacity and load factor.strategy
- used to compute hash codes and to compare keys.public TShortHash(int initialCapacity, TShortHashingStrategy strategy)
TShortHash
instance whose capacity is the next highest prime above
initialCapacity + 1 unless that value is already prime.initialCapacity
- an int
valuestrategy
- used to compute hash codes and to compare keys.public TShortHash(int initialCapacity, float loadFactor, TShortHashingStrategy strategy)
TShortHash
instance with a prime value at or near the specified
capacity and load factor.initialCapacity
- used to find a prime capacity for the table.loadFactor
- used to calculate the threshold over which rehashing takes place.strategy
- used to compute hash codes and to compare keys.public Object clone()
clone
in class TPrimitiveHash
protected int setUp(int initialCapacity)
setUp
in class TPrimitiveHash
initialCapacity
- an int
valuepublic boolean contains(short val)
val
- an short
valueboolean
valuepublic boolean forEach(TShortProcedure procedure)
procedure
- a TObjectProcedure
valueprotected void removeAt(int index)
removeAt
in class TPrimitiveHash
index
- an int
valueprotected int index(short val)
val
- an short
valueprotected int insertionIndex(short val)
val
- an short
valueint
valuepublic final int computeHashCode(short val)
computeHashCode
in interface TShortHashingStrategy
val
- the value to hashCopyright © GigaSpaces.