public class LFUMap<K,V> extends Object implements Serializable, Cloneable
Constructor and Description |
---|
LFUMap(int cacheSize)
Creates a new LFU-Map with a maximum size of
cacheSize entries. |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Object |
clone() |
V |
get(K key)
Return the entry for the given key.
|
int |
getMaximumSize()
Returns the defined maximum size.
|
boolean |
isEmpty()
Checks whether this map is empty.
|
void |
put(K key,
V value)
Puts the given value into the map using the specified non-null key.
|
void |
remove(K key)
Removes the entry for the given key.
|
int |
size()
Returns the number of items in this map.
|
void |
validate()
Validates the map's internal datastructures.
|
public LFUMap(int cacheSize)
cacheSize
entries.cacheSize
- the maximum number of elements this map will be able to store.public void clear()
public V get(K key)
key
- the lookup key.public void put(K key, V value)
key
- the key.value
- the value.public void remove(K key)
key
- the key for which an entry should be removed.public int size()
public boolean isEmpty()
public int getMaximumSize()
public void validate()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException