Class LRU<K,V>
- java.lang.Object
-
- org.glassfish.jersey.internal.util.collection.LRU<K,V>
-
- Type Parameters:
K- Key typeV- Value type
public abstract class LRU<K,V> extends Object
An abstract LRU interface wrapping an actual LRU implementation.
-
-
Constructor Summary
Constructors Constructor Description LRU()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <K,V>
LRU<K,V>create()Create new LRUabstract VgetIfPresent(Object key)Returns the value associated withkeyin this cache, ornullif there is no cached value forkey.abstract voidput(K key, V value)Associatesvaluewithkeyin this cache.
-
-
-
Method Detail
-
getIfPresent
public abstract V getIfPresent(Object key)
Returns the value associated withkeyin this cache, ornullif there is no cached value forkey.
-
put
public abstract void put(K key, V value)
Associatesvaluewithkeyin this cache. If the cache previously contained a value associated withkey, the old value is replaced byvalue.
-
create
public static <K,V> LRU<K,V> create()
Create new LRU- Returns:
- new LRU
-
-