-
- Type Parameters:
K - key typeV - value type
- All Implemented Interfaces:
- Serializable
public class WeakIndexCache<K,V>
extends Object
implements Serializable
A weakly linked cache - elements in the cache can be garbage collected.
- See Also:
- Serialized Form
-
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
WeakIndexCache
public WeakIndexCache()
-
Method Detail
-
cache
public V cache(K s,
V v)
- Parameters:
s - the cache keyv - the cache value
- Returns:
- the cached value
-
get
public V get(K k)
- Parameters:
k - the key
- Returns:
- the value
-
clear
public void clear()
empty the cache.
Copyright © 2014 The University of Manchester. All Rights Reserved.