Package uk.gov.gchq.gaffer.cache.impl
Class HashMapCache<K,V>
- java.lang.Object
-
- uk.gov.gchq.gaffer.cache.impl.HashMapCache<K,V>
-
-
Constructor Summary
Constructors Constructor Description HashMapCache()
HashMapCache(boolean useJavaSerialisation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Remove all entries from the cache.V
get(K key)
Retrieve the value associated with the given key.Set<K>
getAllKeys()
Get all keys present in the cache.Collection<V>
getAllValues()
Get all values present in the cache.void
put(K key, V value)
Add a new key-value pair to the cache.void
remove(K key)
Remove the entry associated with the specified key.int
size()
Get the size of the cache.
-
-
-
Method Detail
-
get
public V get(K key)
Description copied from interface:ICache
Retrieve the value associated with the given key.
-
put
public void put(K key, V value)
Description copied from interface:ICache
Add a new key-value pair to the cache.
-
remove
public void remove(K key)
Description copied from interface:ICache
Remove the entry associated with the specified key.
-
getAllValues
public Collection<V> getAllValues()
Description copied from interface:ICache
Get all values present in the cache.- Specified by:
getAllValues
in interfaceICache<K,V>
- Returns:
- a
Iterable
containing all of the cache values
-
getAllKeys
public Set<K> getAllKeys()
Description copied from interface:ICache
Get all keys present in the cache.- Specified by:
getAllKeys
in interfaceICache<K,V>
- Returns:
- a
Iterable
containing all of the cache keys
-
size
public int size()
Description copied from interface:ICache
Get the size of the cache.
-
-