public class ReferenceHashMap extends org.apache.commons.collections.map.ReferenceMap implements ReferenceMap, SizedMap
org.apache.commons.collections.map.AbstractReferenceMap.ReferenceEntryorg.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.ValuesIteratorAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>HARD, keyType, purgeValues, SOFT, valueType, WEAKdata, 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, valuesHARD, 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, valuesaddEntry, calculateNewCapacity, calculateThreshold, checkCapacity, clone, convertKey, destroyEntry, ensureCapacity, entryHashCode, entryKey, entryNext, entryValue, equals, hash, hashCode, hashIndex, isEqualValue, putAll, removeEntry, removeMapping, reuseEntry, toString, updateEntrypublic ReferenceHashMap(int keyType,
int valueType)
public ReferenceHashMap(int keyType,
int 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.collections.map.AbstractHashedMapprotected 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.AbstractReferenceMapprotected void purge(Reference ref)
purge in class org.apache.commons.collections.map.AbstractReferenceMapprotected void doWriteObject(ObjectOutputStream out) throws IOException
doWriteObject in class org.apache.commons.collections.map.AbstractReferenceMapIOExceptionprotected void doReadObject(ObjectInputStream in) throws ClassNotFoundException, IOException
doReadObject in class org.apache.commons.collections.map.AbstractReferenceMapClassNotFoundExceptionIOExceptionCopyright © 2006–2018 Apache Software Foundation. All rights reserved.