public class ReferenceHashMap extends org.apache.commons.collections4.map.ReferenceMap implements ReferenceMap, SizedMap
org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceEntry<K,V>, org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength
org.apache.commons.collections4.map.AbstractHashedMap.EntrySet<K,V>, org.apache.commons.collections4.map.AbstractHashedMap.EntrySetIterator<K,V>, org.apache.commons.collections4.map.AbstractHashedMap.HashEntry<K,V>, org.apache.commons.collections4.map.AbstractHashedMap.HashIterator<K,V>, org.apache.commons.collections4.map.AbstractHashedMap.HashMapIterator<K,V>, org.apache.commons.collections4.map.AbstractHashedMap.KeySet<K>, org.apache.commons.collections4.map.AbstractHashedMap.KeySetIterator<K>, org.apache.commons.collections4.map.AbstractHashedMap.Values<V>, org.apache.commons.collections4.map.AbstractHashedMap.ValuesIterator<V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
ReferenceHashMap(org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength keyType,
org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength valueType) |
ReferenceHashMap(org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength keyType,
org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength valueType,
int capacity,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
protected void |
addMapping(int hashIndex,
int hashCode,
Object key,
Object value) |
protected org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceEntry |
createEntry(org.apache.commons.collections4.map.AbstractHashedMap.HashEntry next,
int hashCode,
Object key,
Object value) |
protected void |
doReadObject(ObjectInputStream in) |
protected void |
doWriteObject(ObjectOutputStream out) |
int |
getMaxSize()
The maximum number of entries, or Integer.MAX_VALUE for no limit.
|
boolean |
isFull()
Whether the map is full.
|
void |
keyExpired(Object value)
Overridable callback for when a key reference expires.
|
void |
overflowRemoved(Object key,
Object value)
Overridable callback for when an overflow entry is automatically removed.
|
void |
removeExpired()
Purge stale entries.
|
void |
setMaxSize(int maxSize)
The maximum number of entries, or Integer.MAX_VALUE for no limit.
|
void |
valueExpired(Object key)
Overridable callback for when a value reference expires.
|
clear, containsKey, containsValue, createEntrySetIterator, createKeySetIterator, createValuesIterator, entrySet, get, getEntry, hashEntry, init, isEmpty, isEqualKey, isKeyType, isValueType, keySet, mapIterator, purge, purge, purgeBeforeRead, purgeBeforeWrite, put, remove, size, values
addEntry, calculateNewCapacity, calculateThreshold, checkCapacity, clone, convertKey, destroyEntry, ensureCapacity, entryHashCode, entryKey, entryNext, entryValue, equals, hash, hashCode, hashIndex, isEqualValue, putAll, removeEntry, removeMapping, reuseEntry, toString, updateEntry
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public ReferenceHashMap(org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength keyType, org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength valueType)
public ReferenceHashMap(org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength keyType, org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength valueType, int capacity, float loadFactor)
public int getMaxSize()
SizedMap
getMaxSize
in interface SizedMap
public void setMaxSize(int maxSize)
SizedMap
setMaxSize
in interface SizedMap
public boolean isFull()
SizedMap
public void overflowRemoved(Object key, Object value)
SizedMap
overflowRemoved
in interface SizedMap
public void valueExpired(Object key)
ReferenceMap
valueExpired
in interface ReferenceMap
key
- the key for the expired valuepublic void keyExpired(Object value)
ReferenceMap
keyExpired
in interface ReferenceMap
value
- the value for the expired keypublic void removeExpired()
ReferenceMap
removeExpired
in interface ReferenceMap
protected void addMapping(int hashIndex, int hashCode, Object key, Object value)
addMapping
in class org.apache.commons.collections4.map.AbstractHashedMap
protected org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceEntry createEntry(org.apache.commons.collections4.map.AbstractHashedMap.HashEntry next, int hashCode, Object key, Object value)
createEntry
in class org.apache.commons.collections4.map.AbstractReferenceMap
protected void doWriteObject(ObjectOutputStream out) throws IOException
doWriteObject
in class org.apache.commons.collections4.map.AbstractReferenceMap
IOException
protected void doReadObject(ObjectInputStream in) throws ClassNotFoundException, IOException
doReadObject
in class org.apache.commons.collections4.map.AbstractReferenceMap
ClassNotFoundException
IOException
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.