TShortHashingStrategy
, java.io.Serializable
TShortByteHashMap
, TShortDoubleHashMap
, TShortFloatHashMap
, TShortHashSet
, TShortIntHashMap
, TShortLongHashMap
, TShortObjectHashMap
, TShortShortHashMap
public abstract class TShortHash extends TPrimitiveHash implements TShortHashingStrategy
Modifier and Type | Field | Description |
---|---|---|
protected TShortHashingStrategy |
_hashingStrategy |
strategy used to hash values in this collection
|
protected short[] |
_set |
the set of shorts
|
_autoCompactionFactor, _autoCompactRemovesRemaining, _free, _loadFactor, _maxSize, _size, DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR
_states, FREE, FULL, REMOVED
Constructor | 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 | Description |
---|---|---|
java.lang.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.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
calculateGrownCapacity, clear, compact, ensureCapacity, getAutoCompactionFactor, isEmpty, postInsertHook, readExternal, reenableAutoCompaction, rehash, setAutoCompactionFactor, size, tempDisableAutoCompaction, trimToSize, writeExternal
capacity
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 java.lang.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 hashGNU Trove is copyright ? 2001-2009 Eric D. Friedman. All Rights Reserved.