|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<java.lang.Object,T>
org.simpleframework.xml.util.ConcurrentCache<T>
public class ConcurrentCache<T>
The ConcurrentCache
interface is used to represent a
cache that will store key value pairs. This implementation is
backed by a ConcurrentHashMap
for best performance.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
ConcurrentCache()
Constructor for the ConcurrentCache object. |
Method Summary | |
---|---|
void |
cache(java.lang.Object key,
T value)
This method is used to insert a key value mapping in to the cache. |
boolean |
contains(java.lang.Object key)
This is used to determine whether the specified key exists with in the cache. |
T |
fetch(java.lang.Object key)
This method is used to get the value from the cache that is mapped to the specified key. |
T |
take(java.lang.Object key)
This is used to exclusively take the value mapped to the specified key from the cache. |
Methods inherited from class java.util.concurrent.ConcurrentHashMap |
---|
clear, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values |
Methods inherited from class java.util.AbstractMap |
---|
clone, equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.simpleframework.xml.util.Cache |
---|
isEmpty |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public ConcurrentCache()
ConcurrentCache
object. This
is an implementation of a cache that uses the conventional
concurrent hash map from the Java collections API.
Method Detail |
---|
public void cache(java.lang.Object key, T value)
cache
in interface Cache<T>
key
- this is the key to cache the provided value tovalue
- this is the value that is to be cachedpublic T take(java.lang.Object key)
take
in interface Cache<T>
key
- this is the key to acquire the cache value with
public T fetch(java.lang.Object key)
fetch
in interface Cache<T>
key
- this is the key to acquire the cache value with
public boolean contains(java.lang.Object key)
contains
in interface Cache<T>
contains
in class java.util.concurrent.ConcurrentHashMap<java.lang.Object,T>
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 |