|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.config.cache.InMemoryCache<K,V>
K
- type of the key.
V
- type of the value.
@ThreadSafe public final class InMemoryCache<K,V>
Fake implementation of a cache.
Constructor Summary | |
---|---|
InMemoryCache() |
Method Summary | |
---|---|
V |
get(Object key) Returns the value from the cache for the given key. |
Set<K> |
keySet() Returns a set of all keys in the cache. |
void |
put(K key, V value) Put the given value in the cache under the given key. |
void |
put(K key, V value, int lifespan, TimeUnit lifespanTimeUnit, int maxIdleTime, TimeUnit maxIdleTimeTimeUnit) Put the given value with the given properties in the cache under the given key. |
void |
put(K key, V value, long updateIntervalInMs, TimeUnit milliseconds) Put the given value with the given properties in the cache under the given key. |
V |
remove(Object key) Removes the value for the given key. |
long |
size() Fetch the size of the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InMemoryCache()
Method Detail |
---|
public long size()
Cache
size
in interface
Cache<K,V>
public V get(Object key)
UnawareCache
get
in interface
UnawareCache<K,V>
key
- the key to retrieve a value for.
public void put(K key, V value)
UnawareCache
put
in interface
UnawareCache<K,V>
key
- the key to store the value.
value
- the value.
public void put(K key, V value, long updateIntervalInMs, TimeUnit milliseconds)
UnawareCache
put
in interface
UnawareCache<K,V>
key
- the key to store the value.
value
- the value.
updateIntervalInMs
- alue.the update time.
milliseconds
- the time unit.
public void put(K key, V value, int lifespan, TimeUnit lifespanTimeUnit, int maxIdleTime, TimeUnit maxIdleTimeTimeUnit)
UnawareCache
put
in interface
UnawareCache<K,V>
key
- the key to store the value.
value
- the value.
lifespan
- lifespan
lifespanTimeUnit
- lifespanTimeUnit
maxIdleTime
- maxIdleTime
maxIdleTimeTimeUnit
- maxIdleTimeTimeUnit
public V remove(Object key)
UnawareCache
remove
in interface
UnawareCache<K,V>
key
- the key for which the value shall be removed.
public Set<K> keySet()
Cache
keySet
in interface
Cache<K,V>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |