|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.cache.MapToCacheAdapter<K,V>
K - V - public final class MapToCacheAdapter<K,V>
Adapter from Map to Cache
Note: entrySet(), values() and keySet() will return an unmodifiable instance
Cache,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
MapToCacheAdapter(Map<? extends K,? extends V> map)
|
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
Returns an unmodifiable Set of all Map.Entrys within the Cache which only represents a
snapshot in moment |
boolean |
equals(Object o)
|
V |
get(Object key)
|
V |
getOrCreate(K key,
Factory<V> factory)
Gets a cached value or creates a new one using the given Factory and puts the new value into the cache. |
int |
hashCode()
|
boolean |
isEmpty()
|
Set<K> |
keySet()
Returns an unmodifiable Set of all keys within the Cache which only represents a snapshot in moment |
V |
put(K key,
V value)
|
void |
putAll(Map<? extends K,? extends V> m)
|
V |
remove(Object key)
|
int |
size()
|
Collection<V> |
values()
Returns an unmodifiable Collection of all values within the Cache which only represents a snapshot in moment |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapToCacheAdapter(Map<? extends K,? extends V> map)
map - MapToCacheAdapter| Method Detail |
|---|
public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public V get(Object key)
public V put(K key,
V value)
public V remove(Object key)
public void putAll(Map<? extends K,? extends V> m)
public void clear()
public Set<K> keySet()
CacheSet of all keys within the Cache which only represents a snapshot in moment
public Collection<V> values()
CacheCollection of all values within the Cache which only represents a snapshot in moment
public Set<Map.Entry<K,V>> entrySet()
CacheSet of all Map.Entrys within the Cache which only represents a
snapshot in moment
public boolean equals(Object o)
equals in interface Map<K,V>equals in class Objectpublic int hashCode()
hashCode in interface Map<K,V>hashCode in class Object
public V getOrCreate(K key,
Factory<V> factory)
CacheFactory and puts the new value into the cache.
getOrCreate in interface Cache<K,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||