@Generated(date="2017-07-11T19:16:33+0200",
value="KTypeIdentityHashSet.java")
public class ObjectIdentityHashSet<KType>
extends ObjectHashSet<KType>
Object types, implemented using open
addressing with linear probing for collision resolution.
The difference with ObjectHashSet is that it uses direct Object reference equality for comparison and
direct "address" System.identityHashCode(Object) for hashCode(), instead of using
the built-in ObjectHashSet.hashCode() / ObjectHashSet.equals(Object).
This implementation supports null keys.
ObjectHashSet.EntryIteratorallocatedDefaultKey, assigned, entryIteratorPool, hash_cache, keys, loadFactorcontainsNegateTestPredicate, containsTestPredicate, negatePredicate, testContainer, testPredicate| Constructor and Description |
|---|
ObjectIdentityHashSet()
Creates a hash set with the default capacity of
Containers.DEFAULT_EXPECTED_ELEMENTS,
load factor of HashContainers.DEFAULT_LOAD_FACTOR. |
ObjectIdentityHashSet(int initialCapacity)
Creates a hash set with the given capacity,
load factor of
HashContainers.DEFAULT_LOAD_FACTOR. |
ObjectIdentityHashSet(int initialCapacity,
double loadFactor)
Creates a hash set with the given capacity and load factor.
|
ObjectIdentityHashSet(ObjectContainer<KType> container)
Creates a hash set from elements of another container.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectIdentityHashSet<KType> |
clone() |
protected boolean |
equalKeys(KType a,
KType b)
Equality customization to only consider object identity, comparing
instances directly by ==.
|
static <KType> ObjectIdentityHashSet<KType> |
from(KType... elements)
Create a set from a variable number of arguments or an array of
Object. |
static <KType> ObjectIdentityHashSet<KType> |
from(ObjectContainer<KType> container)
Create a set from elements of another container.
|
protected int |
hashKey(KType key)
Hash customization to only consider the identity hash code.
|
static <KType> ObjectIdentityHashSet<KType> |
newInstance()
Create a new hash set with default parameters (shortcut
instead of using a constructor).
|
static <KType> ObjectIdentityHashSet<KType> |
newInstance(int initialCapacity,
double loadFactor)
Returns a new object of this class with no need to declare generic type (shortcut
instead of using a constructor).
|
add, add, add, addAll, addAll, capacity, clear, contains, equals, forEach, forEach, hashCode, iterator, remove, removeAll, removeAll, size, toArrayisEmpty, removeAll, retainAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitremoveAll, retainAll, retainAllisEmpty, toArray, toArraypublic ObjectIdentityHashSet()
Containers.DEFAULT_EXPECTED_ELEMENTS,
load factor of HashContainers.DEFAULT_LOAD_FACTOR.public ObjectIdentityHashSet(int initialCapacity)
HashContainers.DEFAULT_LOAD_FACTOR.public ObjectIdentityHashSet(int initialCapacity,
double loadFactor)
public ObjectIdentityHashSet(ObjectContainer<KType> container)
protected int hashKey(KType key)
hashKey in class ObjectHashSet<KType>key - Object to be hashed.ObjectHashSet.hashCode();ObjectHashSet.hashCode(),
ObjectHashSet.equalKeys(Object, Object)protected boolean equalKeys(KType a, KType b)
equalKeys in class ObjectHashSet<KType>a - not-null Object to be comparedb - not-null Object to be comparedObjectHashSet.equals(Object).ObjectHashSet.equals(Object),
ObjectHashSet.hashKey(Object)public ObjectIdentityHashSet<KType> clone()
ObjectHashSetclone in class ObjectHashSet<KType>public static <KType> ObjectIdentityHashSet<KType> from(KType... elements)
Object.public static <KType> ObjectIdentityHashSet<KType> from(ObjectContainer<KType> container)
public static <KType> ObjectIdentityHashSet<KType> newInstance()
public static <KType> ObjectIdentityHashSet<KType> newInstance(int initialCapacity, double loadFactor)
Copyright © 2017. All rights reserved.