|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache<K,V>
The Cache
interface is used to represent a cache
that will store key value pairs. The cache exposes only several
methods to ensure that implementations can focus on performance
concerns rather than how to manage the cached values.
Method Summary | |
---|---|
void |
cache(K key,
V value)
This method is used to insert a key value mapping in to the cache. |
boolean |
contains(K key)
This is used to determine whether the specified key exists with in the cache. |
V |
fetch(K key)
This method is used to get the value from the cache that is mapped to the specified key. |
V |
take(K key)
This is used to exclusively take the value mapped to the specified key from the cache. |
Method Detail |
---|
void cache(K key, V value)
key
- this is the key to cache the provided value tovalue
- this is the value that is to be cachedV take(K key)
key
- this is the key to acquire the cache value with
V fetch(K key)
key
- this is the key to acquire the cache value with
boolean contains(K key)
key
- this is the key to check within this segment
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |