public class WeakIdentityHashMap<K,V> extends AbstractHashTable<WeakHashNode<K,V>,K,V>
DEFAULT_INITIAL_SIZE, mask, num_bindings, table
Constructor and Description |
---|
WeakIdentityHashMap() |
WeakIdentityHashMap(int capacity) |
Modifier and Type | Method and Description |
---|---|
protected WeakHashNode<K,V>[] |
allocEntries(int n)
Allocate Entry[n].
|
V |
get(java.lang.Object key,
V defaultValue)
Find value for given key.
|
protected int |
getEntryHashCode(WeakHashNode<K,V> entry)
Extract hash-code from Entry.
|
protected WeakHashNode<K,V> |
getEntryNext(WeakHashNode<K,V> entry)
Extract next Entry in same hash-bucket.
|
int |
hash(java.lang.Object key)
Calculate hash code of a key.
|
protected WeakHashNode<K,V> |
makeEntry(K key,
int hash,
V value)
Allocate a new node in the hash table.
|
protected boolean |
matches(K key1,
java.lang.Object key2)
Compare two keys for equivalence.
|
V |
put(K key,
int hash,
V value) |
V |
remove(java.lang.Object key) |
protected void |
setEntryNext(WeakHashNode<K,V> entry,
WeakHashNode<K,V> next)
Set next Entry in same hash-bucket.
|
clear, entrySet, get, getNode, getOrDefault, hashToIndex, matches, put, rehash, size
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
public WeakIdentityHashMap()
public WeakIdentityHashMap(int capacity)
protected int getEntryHashCode(WeakHashNode<K,V> entry)
AbstractHashTable
getEntryHashCode
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
protected WeakHashNode<K,V> getEntryNext(WeakHashNode<K,V> entry)
AbstractHashTable
getEntryNext
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
protected void setEntryNext(WeakHashNode<K,V> entry, WeakHashNode<K,V> next)
AbstractHashTable
setEntryNext
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
protected WeakHashNode<K,V>[] allocEntries(int n)
AbstractHashTable
allocEntries
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
public int hash(java.lang.Object key)
AbstractHashTable
hash
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
protected boolean matches(K key1, java.lang.Object key2)
AbstractHashTable
AbstractHashTable.hash(Object)
method if you want
a different equivalence relation.matches
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
protected WeakHashNode<K,V> makeEntry(K key, int hash, V value)
AbstractHashTable
makeEntry
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
public V get(java.lang.Object key, V defaultValue)
AbstractHashTable
get
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
public V put(K key, int hash, V value)
put
in class AbstractHashTable<WeakHashNode<K,V>,K,V>
public V remove(java.lang.Object key)
remove
in interface java.util.Map<K,V>
remove
in class AbstractHashTable<WeakHashNode<K,V>,K,V>