| Constructor and Description |
|---|
DefaultCache(String name,
int maximumSize)
Default cache manager implementation backed by
LRUMap |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all of the mappings from this map.
|
boolean |
containsKey(KeyType key)
Returns true if this map contains a mapping for the
specified key.
|
ValueType |
get(KeyType key)
Returns the value to which the specified key is mapped,
or
null if this map contains no mapping for the key. |
int |
getMaxSize()
Returns the maximum number of entries which the cache can hold
|
String |
getName()
Returns the name of the overall cache store
|
long |
getSize()
Returns the number of key-value mappings in this map.
|
void |
put(KeyType key,
ValueType value)
Associates the specified value with the specified key in this map.
|
String |
toString() |
public DefaultCache(String name, int maximumSize)
LRUMapname - unique cache namemaximumSize - maximum cache sizepublic void clear()
public void put(KeyType key, ValueType value)
public ValueType get(KeyType key)
null if this map contains no mapping for the key.public String getName()
public long getSize()
public int getMaxSize()
getMaxSize in interface Cache<KeyType,ValueType>public boolean containsKey(KeyType key)
containsKey in interface Cache<KeyType,ValueType>key - The key whose presence in this map is to be testedCopyright © 2005–2021 dozer. All rights reserved.