public abstract class TShortHash extends TPrimitiveHashimplements 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
Creates a new
TShortHash instance with a prime value at or near the specified capacity and load factor.
|
TShortHash(int initialCapacity, TShortHashingStrategy
Creates a new
TShortHash instance whose capacity is the next highest prime above
initialCapacity + 1 unless that value is already prime.
|
TShortHash(TShortHashingStrategy
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
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.
|
capacitycalculateGrownCapacity, clear, compact, ensureCapacity, getAutoCompactionFactor, isEmpty, postInsertHook, readExternal, reenableAutoCompaction, rehash, setAutoCompactionFactor, size, tempDisableAutoCompaction, trimToSize, writeExternalprotected 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 value
public 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(TShortHashingStrategystrategy)
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 value
strategy - 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 Objectclone()
clone in class
TPrimitiveHash
protected int setUp(int initialCapacity)
setUp in class
TPrimitiveHash
initialCapacity - an
int value
public boolean contains(short val)
val - an
short value
boolean value
public boolean forEach(TShortProcedureprocedure)
procedure - a
TObjectProcedure value
protected void removeAt(int index)
removeAt in class
TPrimitiveHash
index - an
int value
protected int index(short val)
val - an
short value
protected int insertionIndex(short val)
val - an
short value
int value
public final int computeHashCode(short val)
computeHashCode in interface
TShortHashingStrategy
val - the value to hash