K
- the map key typeV
- the map value typepublic abstract class CapacityLimitedHashtable<K,V> extends ConcurrentHashMap<K,V>
ConcurrentHashMap.KeySetView<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
CapacityLimitedHashtable(long capacity) |
Modifier and Type | Method and Description |
---|---|
int |
currentSize()
Return the current size of all of the table's values as judged by the implementation of getObjectSize.
|
V |
get(Object key)
Retrieve a value from the map.
|
abstract long |
getObjectSize(V obj)
Return the size this object will be inside of this hashtable.
|
V |
put(K key,
V value)
Maps the specified key to the specified value in this table.
|
V |
remove(Object key)
Removes the key (and its corresponding value) from this map.
|
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 CapacityLimitedHashtable(long capacity)
capacity
- The maximum capacity the map will allow before ejecting values. What this value means depends on
the implementation of getObjectSize.public int currentSize()
public abstract long getObjectSize(V obj)
obj
- An object to sizepublic V remove(Object key)
remove
in interface Map<K,V>
remove
in class ConcurrentHashMap<K,V>
key
- the key that needs to be removedkey
, or
null
if there was no mapping for key
NullPointerException
- if the specified key is nullpublic V put(K key, V value)
put
in interface Map<K,V>
put
in class ConcurrentHashMap<K,V>
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keykey
, or
null
if there was no mapping for key
NullPointerException
- if the specified key or value is nullConcurrentHashMap.put(java.lang.Object, java.lang.Object)
public V get(Object key)
get
in interface Map<K,V>
get
in class ConcurrentHashMap<K,V>
key
- the key the value was stored withConcurrentHashMap.get(java.lang.Object)
Copyright © 2019 Snowbound Software Corporation. All rights reserved.