Package gnu.trove.impl.hash
Class TCustomObjectHash<T>
- java.lang.Object
-
- gnu.trove.impl.hash.THash
-
- gnu.trove.impl.hash.TObjectHash<T>
-
- gnu.trove.impl.hash.TCustomObjectHash<T>
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
- Direct Known Subclasses:
TCustomHashMap
,TCustomHashSet
,TObjectByteCustomHashMap
,TObjectCharCustomHashMap
,TObjectDoubleCustomHashMap
,TObjectFloatCustomHashMap
,TObjectIntCustomHashMap
,TObjectLongCustomHashMap
,TObjectShortCustomHashMap
public abstract class TCustomObjectHash<T> extends TObjectHash<T>
An open addressed hashing implementation for Object types.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected HashingStrategy<? super T>
strategy
-
Fields inherited from class gnu.trove.impl.hash.TObjectHash
_set, consumeFreeSlot, FREE, REMOVED
-
Fields inherited from class gnu.trove.impl.hash.THash
_autoCompactionFactor, _autoCompactRemovesRemaining, _autoCompactTemporaryDisable, _free, _loadFactor, _maxSize, _size, DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR
-
-
Constructor Summary
Constructors Constructor Description TCustomObjectHash()
FOR EXTERNALIZATION ONLY!!!TCustomObjectHash(HashingStrategy<? super T> strategy)
Creates a newTManualObjectHash
instance with the default capacity and load factor.TCustomObjectHash(HashingStrategy<? super T> strategy, int initialCapacity)
Creates a newTManualObjectHash
instance whose capacity is the next highest prime above initialCapacity + 1 unless that value is already prime.TCustomObjectHash(HashingStrategy<? super T> strategy, int initialCapacity, float loadFactor)
Creates a newTManualObjectHash
instance with a prime value at or near the specified capacity and load factor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
equals(java.lang.Object one, java.lang.Object two)
protected int
hash(java.lang.Object obj)
void
readExternal(java.io.ObjectInput in)
void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class gnu.trove.impl.hash.TObjectHash
buildObjectContractViolation, capacity, contains, dumpExtraInfo, forEach, index, insertionIndex, insertKey, objectInfo, removeAt, reportPotentialConcurrentMod, setUp, throwObjectContractViolation, throwObjectContractViolation
-
Methods inherited from class gnu.trove.impl.hash.THash
calculateGrownCapacity, clear, compact, computeMaxSize, computeNextAutoCompactionAmount, ensureCapacity, fastCeil, getAutoCompactionFactor, isEmpty, postInsertHook, reenableAutoCompaction, rehash, saturatedCast, setAutoCompactionFactor, size, tempDisableAutoCompaction, trimToSize
-
-
-
-
Field Detail
-
strategy
protected HashingStrategy<? super T> strategy
-
-
Constructor Detail
-
TCustomObjectHash
public TCustomObjectHash()
FOR EXTERNALIZATION ONLY!!!
-
TCustomObjectHash
public TCustomObjectHash(HashingStrategy<? super T> strategy)
Creates a newTManualObjectHash
instance with the default capacity and load factor.
-
TCustomObjectHash
public TCustomObjectHash(HashingStrategy<? super T> strategy, int initialCapacity)
Creates a newTManualObjectHash
instance whose capacity is the next highest prime above initialCapacity + 1 unless that value is already prime.- Parameters:
initialCapacity
- anint
value
-
TCustomObjectHash
public TCustomObjectHash(HashingStrategy<? super T> strategy, int initialCapacity, float loadFactor)
Creates a newTManualObjectHash
instance with a prime value at or near the specified capacity and load factor.- Parameters:
initialCapacity
- used to find a prime capacity for the table.loadFactor
- used to calculate the threshold over which rehashing takes place.
-
-
Method Detail
-
hash
protected int hash(java.lang.Object obj)
- Overrides:
hash
in classTObjectHash<T>
-
equals
protected boolean equals(java.lang.Object one, java.lang.Object two)
- Overrides:
equals
in classTObjectHash<T>
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Overrides:
writeExternal
in classTObjectHash<T>
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Overrides:
readExternal
in classTObjectHash<T>
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-