public class LongKeyHashMap<E>
extends java.lang.Object
Null keys are not allowed. LruCache is synchronized.
Constructor and Description |
---|
LongKeyHashMap()
Create the clock cache with a specific capacity.
|
LongKeyHashMap(int initialCapacity)
Create the clock cache with a specific capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the map
|
E |
get(long key)
Get an item from the cache and make it most recently used.
|
E |
put(long key,
E value)
Puts a new item in the cache.
|
E |
remove(long key)
Removes an item from the map
|
int |
size()
Returns the current number of entries in the cache.
|
java.util.Iterator<E> |
valueIterator() |
public LongKeyHashMap()
initialCapacity
- minimum capacity of the cachepublic LongKeyHashMap(int initialCapacity)
initialCapacity
- minimum capacity of the cachepublic int size()
public void clear()
public E get(long key)
key
- key to lookup the itempublic E put(long key, E value)
key
- key to store datavalue
- value to be storedpublic E remove(long key)
key
- the key to removepublic java.util.Iterator<E> valueIterator()