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 newTManualObjectHashinstance with the default capacity and load factor.TCustomObjectHash(HashingStrategy<? super T> strategy, int initialCapacity)Creates a newTManualObjectHashinstance 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 newTManualObjectHashinstance 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 booleanequals(java.lang.Object one, java.lang.Object two)protected inthash(java.lang.Object obj)voidreadExternal(java.io.ObjectInput in)voidwriteExternal(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 newTManualObjectHashinstance with the default capacity and load factor.
-
TCustomObjectHash
public TCustomObjectHash(HashingStrategy<? super T> strategy, int initialCapacity)
Creates a newTManualObjectHashinstance whose capacity is the next highest prime above initialCapacity + 1 unless that value is already prime.- Parameters:
initialCapacity- anintvalue
-
TCustomObjectHash
public TCustomObjectHash(HashingStrategy<? super T> strategy, int initialCapacity, float loadFactor)
Creates a newTManualObjectHashinstance 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:
hashin classTObjectHash<T>
-
equals
protected boolean equals(java.lang.Object one, java.lang.Object two)- Overrides:
equalsin classTObjectHash<T>
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Overrides:
writeExternalin classTObjectHash<T>- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Overrides:
readExternalin classTObjectHash<T>- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-