public class LRUMap extends org.apache.commons.collections4.map.LRUMap implements SizedMap
LRUMap
that can change its
maximum size.org.apache.commons.collections4.map.AbstractLinkedMap.EntrySetIterator<K,V>, org.apache.commons.collections4.map.AbstractLinkedMap.KeySetIterator<K>, org.apache.commons.collections4.map.AbstractLinkedMap.LinkEntry<K,V>, org.apache.commons.collections4.map.AbstractLinkedMap.LinkIterator<K,V>, org.apache.commons.collections4.map.AbstractLinkedMap.LinkMapIterator<K,V>, org.apache.commons.collections4.map.AbstractLinkedMap.ValuesIterator<V>
org.apache.commons.collections4.map.AbstractHashedMap.EntrySet<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.Values<V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LRUMap() |
LRUMap(int initCapacity) |
LRUMap(int initCapacity,
float loadFactor) |
LRUMap(Map map) |
Modifier and Type | Method and Description |
---|---|
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.
|
int |
maxSize() |
void |
overflowRemoved(Object key,
Object value)
Overridable callback for when an overflow entry is automatically removed.
|
protected boolean |
removeLRU(org.apache.commons.collections4.map.AbstractLinkedMap.LinkEntry entry) |
void |
setMaxSize(int max)
The maximum number of entries, or Integer.MAX_VALUE for no limit.
|
addMapping, clone, get, get, isScanUntilRemovable, moveToMRU, reuseMapping, updateEntry
addEntry, clear, containsValue, createEntry, createEntrySetIterator, createKeySetIterator, createValuesIterator, entryAfter, entryBefore, firstKey, getEntry, getEntry, init, lastKey, mapIterator, nextKey, previousKey, removeEntry
calculateNewCapacity, calculateThreshold, checkCapacity, containsKey, convertKey, destroyEntry, ensureCapacity, entryHashCode, entryKey, entryNext, entrySet, entryValue, equals, hash, hashCode, hashIndex, isEmpty, isEqualKey, isEqualValue, keySet, put, putAll, remove, removeMapping, reuseEntry, size, toString, values
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 LRUMap()
public LRUMap(int initCapacity)
public LRUMap(int initCapacity, float loadFactor)
public LRUMap(Map map)
public int getMaxSize()
SizedMap
getMaxSize
in interface SizedMap
public void setMaxSize(int max)
SizedMap
setMaxSize
in interface SizedMap
public void overflowRemoved(Object key, Object value)
SizedMap
overflowRemoved
in interface SizedMap
public int maxSize()
maxSize
in interface org.apache.commons.collections4.BoundedMap
maxSize
in class org.apache.commons.collections4.map.LRUMap
public boolean isFull()
SizedMap
protected boolean removeLRU(org.apache.commons.collections4.map.AbstractLinkedMap.LinkEntry entry)
removeLRU
in class org.apache.commons.collections4.map.LRUMap
protected void doWriteObject(ObjectOutputStream out) throws IOException
doWriteObject
in class org.apache.commons.collections4.map.LRUMap
IOException
protected void doReadObject(ObjectInputStream in) throws IOException, ClassNotFoundException
doReadObject
in class org.apache.commons.collections4.map.LRUMap
IOException
ClassNotFoundException
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.