K
- key typeV
- value typepublic class LRUHashtable<K,V> extends CapacityLimitedHashtable<K,V>
CapacityLimitedHashtable
that only allows a specific number of entries before ejecting the
least-recently-used items.CapacityLimitedHashtable
,
Serialized FormConcurrentHashMap.KeySetView<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LRUHashtable(long max)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
getObjectSize(Object obj)
Always returns 1; this makes capacity a measure of the number of items in the table.
|
currentSize, get, put, remove
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
public LRUHashtable(long max)
max
- Maximum capacity of this table in number of items.public long getObjectSize(Object obj)
getObjectSize
in class CapacityLimitedHashtable<K,V>
obj
- object to size; since this always returns 1 its value does not matterCopyright © 2020 Snowbound Software Corporation. All rights reserved.