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()
Cache
public void clearByKey(Number key)
Cache
clearByKey
in interface Cache<Number,V>
key
- the keypublic void clearByValue(V value)
Cache
clearByValue
in interface Cache<Number,V>
value
- the valuepublic V get(Number key)
Cache
public Cache<Number,V> getCache()
CacheProvider
getCache
in interface CacheProvider<Number,V>
public List<V> getStorage()
protected void init()
public V put(Number key, V value)
Cache
Copyright © 2010-2020 Toolsverse. All Rights Reserved.