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.ReferenceStrengthorg.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, valuesaddEntry, calculateNewCapacity, calculateThreshold, checkCapacity, clone, convertKey, destroyEntry, ensureCapacity, entryHashCode, entryKey, entryNext, entryValue, equals, hash, hashCode, hashIndex, isEqualValue, putAll, removeEntry, removeMapping, reuseEntry, toString, updateEntryfinalize, getClass, notify, notifyAll, wait, wait, waitclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic 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()
SizedMapgetMaxSize in interface SizedMappublic void setMaxSize(int maxSize)
SizedMapsetMaxSize in interface SizedMappublic boolean isFull()
SizedMappublic void overflowRemoved(Object key, Object value)
SizedMapoverflowRemoved in interface SizedMappublic void valueExpired(Object key)
ReferenceMapvalueExpired in interface ReferenceMapkey - the key for the expired valuepublic void keyExpired(Object value)
ReferenceMapkeyExpired in interface ReferenceMapvalue - the value for the expired keypublic void removeExpired()
ReferenceMapremoveExpired in interface ReferenceMapprotected void addMapping(int hashIndex,
int hashCode,
Object key,
Object value)
addMapping in class org.apache.commons.collections4.map.AbstractHashedMapprotected 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.AbstractReferenceMapprotected void doWriteObject(ObjectOutputStream out) throws IOException
doWriteObject in class org.apache.commons.collections4.map.AbstractReferenceMapIOExceptionprotected void doReadObject(ObjectInputStream in) throws ClassNotFoundException, IOException
doReadObject in class org.apache.commons.collections4.map.AbstractReferenceMapClassNotFoundExceptionIOExceptionCopyright © 2006–2020 Apache Software Foundation. All rights reserved.