public class HashMapImpl<K,V>
extends java.util.AbstractMap<K,V>
Constructor and Description |
---|
HashMapImpl()
Create the hash map impl with a specific capacity.
|
HashMapImpl(int initialCapacity)
Create the hash map impl with a specific capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the cache
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns the entry set of the cache
|
V |
get(java.lang.Object key)
Get an item from the cache and make it most recently used.
|
java.util.Set<K> |
keySet()
Returns the entry set of the cache
|
V |
put(K key,
V value)
Puts a new item in the cache.
|
V |
remove(java.lang.Object key)
Removes an item from the cache
|
int |
size()
Returns the current number of entries in the cache.
|
clone, containsKey, containsValue, equals, hashCode, isEmpty, putAll, toString, values
public HashMapImpl()
initialCapacity
- minimum capacity of the cachepublic HashMapImpl(int initialCapacity)
initialCapacity
- minimum capacity of the cachepublic int size()
public void clear()
public V get(java.lang.Object key)
public V remove(java.lang.Object key)
public java.util.Set<K> keySet()