|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cache<K,V>
Abstraction over cache providers
Nested Class Summary | |
---|---|
static class |
Cache.Type
|
Method Summary | |
---|---|
Cache |
addChild(java.lang.String name)
Add a child node to the current cache node |
void |
addListener(CacheListener listener)
Listener to get the updates on this Cache |
void |
clear()
Removes all the keys and their values from the Cache |
V |
get(K key)
Retrieves the value for the given Key |
Cache |
getChild(java.lang.String name)
Get the child cache node from the current node |
java.util.List<Cache> |
getChildren()
Get child nodes under this cache node. |
java.lang.String |
getName()
Name of the cache node |
java.util.Set<K> |
keySet()
Returns a Set containing the data in this Cache |
V |
put(K key,
V value)
Associates the specified value with the specified key this cache. |
V |
remove(K key)
Removes the value for this key from a Cache. |
boolean |
removeChild(java.lang.String name)
Destroys the child from the current node; no-op if node not found |
void |
removeListener()
Remove Listener to stop the updates on this Cache |
int |
size()
Size of the cache |
java.util.Collection<V> |
values()
Returns a Collection containing the data in this Cache |
Method Detail |
---|
V get(K key)
key
- key under which value is to be retrieved.
V put(K key, V value)
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
null
if there was no mapping for key.
A null
return can also indicate that the key previously associated null
with the specified key,
if the implementation supports null values.V remove(K key)
null
if the Key contained no mapping.
key
- key whose mapping is to be removed
int size()
java.util.Set<K> keySet()
Set
containing the data in this Cache
Set
containing the data in this Cache. If there is no data,
an empty Set
is returned. The Set
returned is always immutable.void clear()
void addListener(CacheListener listener)
listener
- void removeListener()
listener
- java.util.Collection<V> values()
Collection
containing the data in this Cache
Collection
containing the data in this Cache. If there is no data,
an empty Collection
is returned.Cache addChild(java.lang.String name)
name
- - name of the child
Cache getChild(java.lang.String name)
name
-
boolean removeChild(java.lang.String name)
name
-
java.util.List<Cache> getChildren()
java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |