public static class Maps.StrongLinkedHashMap<K,V> extends Maps.AbstractLinkedHashMap<K,V,Maps.StrongLinkedEntry<K,V>>
Maps.AbstractLinkedHashMap, based on
Maps.StrongLinkedEntry. Maps.StrongLinkedHashMap is a drop-in
replacement for LinkedHashMap which additionally exposes
the subclass hooks provided by Maps.AbstractHashMap.LinkedHashMap,
Serialized FormDEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, MAXIMUM_CAPACITY| Constructor and Description |
|---|
StrongLinkedHashMap()
Constructs an empty insertion-ordered map with default capacity and load
factor.
|
StrongLinkedHashMap(int initialCapacity)
Constructs an empty insertion-ordered map with specified initial
capacity and default load factor.
|
StrongLinkedHashMap(int initialCapacity,
float loadFactor)
Constructs an empty insertion-ordered map with specified initial
capacity and load factor.
|
StrongLinkedHashMap(int initialCapacity,
float loadFactor,
boolean accessOrder)
Constructs an empty map with specified initial capacity, load factor,
and iteration order.
|
StrongLinkedHashMap(java.util.Map<? extends K,? extends V> map)
Constructs an insertion-ordered map with specified initial mappings,
initial capacity based on the number of initial mappings, and default
load factor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Maps.StrongLinkedEntry<K,V> |
createEntry(int hash,
K key,
V value,
Maps.StrongLinkedEntry<K,V> next)
Creates an entry for this map.
|
clear, createEntryIterator, createEntrySetIterator, createKeySetIterator, createValuesIterator, entryEvicted, evict, evictEntry, getEldestEntry, mapChanged, removeEldestEntry, transferaddEntry, capacity, change, clone, containsKey, containsValue, entryAccessed, entryAdded, entryChanged, entryPurged, entryRemoved, entrySet, equals, get, getChangeCount, getEntry, getQueue, hashCode, isEmpty, keyEquals, keyHashCode, keySet, loadFactor, mapConstructed, mapInitialized, purge, purgeEntry, put, putAll, remove, removeExistingEntry, removeKey, size, toString, valueEquals, valueHashCode, valuespublic StrongLinkedHashMap()
public StrongLinkedHashMap(int initialCapacity)
initialCapacity - the initial capacity.java.lang.IllegalArgumentException - if the initial capacity is negative.Maps.AbstractHashMap.DEFAULT_LOAD_FACTORpublic StrongLinkedHashMap(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity.loadFactor - the load factor.java.lang.IllegalArgumentException - if the initial capacity is negative
or the load factor is nonpositive.public StrongLinkedHashMap(java.util.Map<? extends K,? extends V> map)
map - A map providing initial mappings.java.lang.NullPointerException - if the specified map is null.Maps.AbstractHashMap.DEFAULT_LOAD_FACTORpublic StrongLinkedHashMap(int initialCapacity,
float loadFactor,
boolean accessOrder)
initialCapacity - the initial capacity.loadFactor - the load factor.accessOrder - true if iteration is access-ordered, false if
insertion-ordered.java.lang.IllegalArgumentException - if the initial capacity is negative
or the load factor is nonpositive.protected Maps.StrongLinkedEntry<K,V> createEntry(int hash, K key, V value, Maps.StrongLinkedEntry<K,V> next)
The Maps.StrongLinkedHashMap implementation creates Maps.StrongLinkedEntry entries.
createEntry in class Maps.AbstractHashMap<K,V,Maps.StrongLinkedEntry<K,V>>hash - The hashCode of the key for this entry.key - The key for this entry.value - The value for this entry.next - The entry to follow this entry in the entry chain.