public class ReferenceHashMap extends org.apache.commons.collections.map.ReferenceMap implements ReferenceMap, SizedMap
org.apache.commons.collections.map.AbstractReferenceMap.ReferenceEntry
org.apache.commons.collections.map.AbstractHashedMap.EntrySet, org.apache.commons.collections.map.AbstractHashedMap.EntrySetIterator, org.apache.commons.collections.map.AbstractHashedMap.HashEntry, org.apache.commons.collections.map.AbstractHashedMap.HashIterator, org.apache.commons.collections.map.AbstractHashedMap.HashMapIterator, org.apache.commons.collections.map.AbstractHashedMap.KeySet, org.apache.commons.collections.map.AbstractHashedMap.KeySetIterator, org.apache.commons.collections.map.AbstractHashedMap.Values, org.apache.commons.collections.map.AbstractHashedMap.ValuesIterator
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
HARD, keyType, purgeValues, SOFT, valueType, WEAK
data, DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD, entrySet, GETKEY_INVALID, GETVALUE_INVALID, keySet, loadFactor, MAXIMUM_CAPACITY, modCount, NO_NEXT_ENTRY, NO_PREVIOUS_ENTRY, NULL, REMOVE_INVALID, SETVALUE_INVALID, size, threshold, values
HARD, SOFT, WEAK
Constructor and Description |
---|
ReferenceHashMap(int keyType,
int valueType) |
ReferenceHashMap(int keyType,
int 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.collections.map.AbstractHashedMap.HashEntry |
createEntry(org.apache.commons.collections.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.
|
protected void |
purge(Reference ref) |
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, keySet, mapIterator, 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
public ReferenceHashMap(int keyType, int valueType)
public ReferenceHashMap(int keyType, int 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.collections.map.AbstractHashedMap
protected org.apache.commons.collections.map.AbstractHashedMap.HashEntry createEntry(org.apache.commons.collections.map.AbstractHashedMap.HashEntry next, int hashCode, Object key, Object value)
createEntry
in class org.apache.commons.collections.map.AbstractReferenceMap
protected void purge(Reference ref)
purge
in class org.apache.commons.collections.map.AbstractReferenceMap
protected void doWriteObject(ObjectOutputStream out) throws IOException
doWriteObject
in class org.apache.commons.collections.map.AbstractReferenceMap
IOException
protected void doReadObject(ObjectInputStream in) throws ClassNotFoundException, IOException
doReadObject
in class org.apache.commons.collections.map.AbstractReferenceMap
ClassNotFoundException
IOException
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.