public class ObjectIdentityHashSet<KType> extends ObjectHashSet<KType>
ObjectHashSet.EntryIteratorassigned, hasEmptyKey, keyMixer, keys, loadFactor, mask, orderMixer, resizeAt| Constructor and Description |
|---|
ObjectIdentityHashSet()
New instance with sane defaults.
|
ObjectIdentityHashSet(int expectedElements)
New instance with sane defaults.
|
ObjectIdentityHashSet(int expectedElements,
double loadFactor)
New instance with sane defaults.
|
ObjectIdentityHashSet(int expectedElements,
double loadFactor,
HashOrderMixingStrategy orderMixer)
New instance with the provided defaults.
|
ObjectIdentityHashSet(ObjectContainer<? extends KType> container)
New instance copying elements from another
ObjectContainer. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
equals(java.lang.Object v1,
java.lang.Object v2) |
static <KType> ObjectIdentityHashSet<KType> |
from(KType... elements)
Create a set from a variable number of arguments or an array of
KType. |
protected int |
hashKey(KType key)
Returns a hash code for the given key.
|
add, addAll, addAll, addAll, allocateBuffers, allocateThenInsertThenRehash, clear, clone, contains, ensureCapacity, equals, forEach, forEach, hashCode, indexExists, indexGet, indexInsert, indexOf, indexReplace, isEmpty, iterator, rehash, release, remove, removeAll, removeAll, shiftConflictingKeys, size, toArray, verifyLoadFactor, visualizeKeyDistributionremoveAll, retainAll, retainAll, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitremoveAll, retainAll, retainAlltoArraypublic ObjectIdentityHashSet()
public ObjectIdentityHashSet(int expectedElements)
public ObjectIdentityHashSet(int expectedElements,
double loadFactor)
public ObjectIdentityHashSet(int expectedElements,
double loadFactor,
HashOrderMixingStrategy orderMixer)
expectedElements - The expected number of elements guaranteed not to cause a rehash (inclusive).loadFactor - The load factor for internal buffers. Insane load factors (zero, full capacity)
are rejected by ObjectHashSet.verifyLoadFactor(double).orderMixer - Hash key order mixing strategy. See HashOrderMixing for predefined
implementations. Use constant mixers only if you understand the potential
consequences.public ObjectIdentityHashSet(ObjectContainer<? extends KType> container)
ObjectContainer.protected int hashKey(KType key)
ObjectHashSetObjectHashSet.keyMixer
to differentiate hash order of keys between hash containers. Helps
alleviate problems resulting from linear conflict resolution in open
addressing.
The output from this function should evenly distribute keys across the
entire integer range.hashKey in class ObjectHashSet<KType>protected boolean equals(java.lang.Object v1,
java.lang.Object v2)
equals in class AbstractObjectCollection<KType>@SafeVarargs public static <KType> ObjectIdentityHashSet<KType> from(KType... elements)
KType. The elements are copied from the argument to the
internal buffer.