V - the value typepublic class ListMemoryCache<V> extends Object implements Cache<Number,V>
| Constructor and Description |
|---|
ListMemoryCache()
Instantiates a new ListMemoryCache.
|
| Modifier and Type | Method and Description |
|---|---|
V |
add(V value)
Adds the value to the cache
|
void |
clear()
Clears the cache.
|
void |
clearByKey(Number key)
Removes cache entry by key.
|
void |
clearByValue(V value)
Removes cache entry by value.
|
V |
get(Number key)
Gets the object stored in the cache by key.
|
Cache<Number,V> |
getCache()
Gets the cache.
|
List<V> |
getStorage()
Gets the storage.
|
protected void |
init()
Instantiate storage.
|
V |
put(Number key,
V value)
Puts the object into the cache.
|
int |
size()
Returns size of the cache.
|
public V add(V value)
value - the valuepublic void clear()
Cachepublic void clearByKey(Number key)
CacheclearByKey in interface Cache<Number,V>key - the keypublic void clearByValue(V value)
CacheclearByValue in interface Cache<Number,V>value - the valuepublic V get(Number key)
Cachepublic Cache<Number,V> getCache()
CacheProvidergetCache in interface CacheProvider<Number,V>public List<V> getStorage()
protected void init()
public V put(Number key, V value)
CacheCopyright © 2010-2020 Toolsverse. All Rights Reserved.