public abstract class AbstractWeakHashTable<K,V> extends AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractWeakHashTable.WEntry<K,V> |
DEFAULT_INITIAL_SIZE, mask, num_bindings, table
Constructor and Description |
---|
AbstractWeakHashTable() |
AbstractWeakHashTable(int capacity) |
Modifier and Type | Method and Description |
---|---|
protected AbstractWeakHashTable.WEntry<K,V>[] |
allocEntries(int n)
Allocate Entry[n].
|
protected void |
cleanup() |
V |
get(java.lang.Object key,
V defaultValue)
Find value for given key.
|
protected int |
getEntryHashCode(AbstractWeakHashTable.WEntry<K,V> entry)
Extract hash-code from Entry.
|
protected AbstractWeakHashTable.WEntry<K,V> |
getEntryNext(AbstractWeakHashTable.WEntry<K,V> entry)
Extract next Entry in same hash-bucket.
|
protected abstract K |
getKeyFromValue(V value) |
protected V |
getValueIfMatching(AbstractWeakHashTable.WEntry<K,V> node,
java.lang.Object key) |
int |
hash(java.lang.Object key)
Calculate hash code of a key.
|
protected AbstractWeakHashTable.WEntry<K,V> |
makeEntry(K key,
int hash,
V value)
Allocate a new node in the hash table.
|
V |
put(K key,
V value) |
protected void |
setEntryNext(AbstractWeakHashTable.WEntry<K,V> entry,
AbstractWeakHashTable.WEntry<K,V> next)
Set next Entry in same hash-bucket.
|
protected boolean |
valuesEqual(V oldValue,
V newValue) |
clear, entrySet, get, getNode, getOrDefault, hashToIndex, matches, matches, put, rehash, remove, size
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
public AbstractWeakHashTable()
public AbstractWeakHashTable(int capacity)
protected int getEntryHashCode(AbstractWeakHashTable.WEntry<K,V> entry)
AbstractHashTable
getEntryHashCode
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
protected AbstractWeakHashTable.WEntry<K,V> getEntryNext(AbstractWeakHashTable.WEntry<K,V> entry)
AbstractHashTable
getEntryNext
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
protected void setEntryNext(AbstractWeakHashTable.WEntry<K,V> entry, AbstractWeakHashTable.WEntry<K,V> next)
AbstractHashTable
setEntryNext
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
protected AbstractWeakHashTable.WEntry<K,V>[] allocEntries(int n)
AbstractHashTable
allocEntries
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
protected V getValueIfMatching(AbstractWeakHashTable.WEntry<K,V> node, java.lang.Object key)
public V get(java.lang.Object key, V defaultValue)
AbstractHashTable
get
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
public int hash(java.lang.Object key)
AbstractHashTable
hash
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
protected AbstractWeakHashTable.WEntry<K,V> makeEntry(K key, int hash, V value)
AbstractHashTable
makeEntry
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
public V put(K key, V value)
put
in interface java.util.Map<K,V>
put
in class AbstractHashTable<AbstractWeakHashTable.WEntry<K,V>,K,V>
protected void cleanup()