Package de.focus_shift.util
Class Cache<V>
- java.lang.Object
-
- de.focus_shift.util.Cache<V>
-
- Type Parameters:
V- the type of cached values
public class Cache<V> extends Object
Cache implementation which handles concurrent access to cached values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCache.ValueHandler<V>
-
Constructor Summary
Constructors Constructor Description Cache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the cache.Vget(Cache.ValueHandler<V> valueHandler)Returns the value defined by theCache.ValueHandler
-
-
-
Method Detail
-
get
public V get(Cache.ValueHandler<V> valueHandler)
Returns the value defined by theCache.ValueHandler- Parameters:
valueHandler- which creates the key and the value if necessary- Returns:
- the eventually cached value
-
clear
public void clear()
Clears the cache.
-
-