| Modifier and Type | Field and Description |
|---|---|
| public int | assigned
Cached number of assigned slots. |
| public static final float | DEFAULT_LOAD_FACTOR
Default load factor. |
| public Object[] | keys
All of set entries. |
| public final float | loadFactor
The load factor for this set (fraction of allocated or deleted slots before the buffers must be rehashed or reallocated). |
| public static final int | MIN_CAPACITY
Minimum capacity for the set. |
| private int | resizeThreshold
Cached capacity threshold at which we must resize the buffers. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | IdentityHashSet(int initialCapacity)
Creates a hash set with the given capacity, load factor of 0.75. |
| public | IdentityHashSet(int initialCapacity, float loadFactor)
Creates a hash set with the given capacity and load factor. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| private void | allocateBuffers(int
New capacity (must be a power of two). capacity)Allocate internal buffers for a given capacity. |
| public void | |
| public boolean | |
| private void | expandAndRehash()
Expand the internal storage buffers (capacity) or rehash current keys and values if there are a lot of deleted slots. |
| public boolean | |
| public Iterator | |
| protected int | nextCapacity(int current)
Return the next possible capacity, counting from the current buffers' size. |
| private static int | |
| protected int | |
| public int |
| assigned | back to summary |
|---|---|
| public int assigned Cached number of assigned slots. | |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| public static final float DEFAULT_LOAD_FACTOR Default load factor. | |
| keys | back to summary |
|---|---|
| public Object[] keys All of set entries. Always of power of two length. | |
| loadFactor | back to summary |
|---|---|
| public final float loadFactor The load factor for this set (fraction of allocated or deleted slots before the buffers must be rehashed or reallocated). | |
| MIN_CAPACITY | back to summary |
|---|---|
| public static final int MIN_CAPACITY Minimum capacity for the set. | |
| resizeThreshold | back to summary |
|---|---|
| private int resizeThreshold Cached capacity threshold at which we must resize the buffers. | |
| IdentityHashSet | back to summary |
|---|---|
| public IdentityHashSet() Creates a hash set with the default capacity of 16. load factor of 0.75. ` | |
| IdentityHashSet | back to summary |
|---|---|
| public IdentityHashSet(int initialCapacity) Creates a hash set with the given capacity, load factor of 0.75. | |
| IdentityHashSet | back to summary |
|---|---|
| public IdentityHashSet(int initialCapacity, float loadFactor) Creates a hash set with the given capacity and load factor. | |
| add | back to summary |
|---|---|
| public boolean add(KType e) Adds a reference to the set. Null keys are not allowed. | |
| allocateBuffers | back to summary |
|---|---|
| private void allocateBuffers(int capacity) Allocate internal buffers for a given capacity.
| |
| clear | back to summary |
|---|---|
| public void clear() | |
| contains | back to summary |
|---|---|
| public boolean contains(KType e) Checks if the set contains a given ref. | |
| expandAndRehash | back to summary |
|---|---|
| private void expandAndRehash() Expand the internal storage buffers (capacity) or rehash current keys and values if there are a lot of deleted slots. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type | |
| nextCapacity | back to summary |
|---|---|
| protected int nextCapacity(int current) Return the next possible capacity, counting from the current buffers' size. | |
| rehash | back to summary |
|---|---|
| private static int rehash(Object o) Rehash via MurmurHash. | |
| roundCapacity | back to summary |
|---|---|
| protected int roundCapacity(int requestedCapacity) Round the capacity to the next allowed value. | |
| size | back to summary |
|---|---|
| public int size() | |