java.util.Map instance
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_INITIAL_CAPACITY
The default initial capacity |
| public static final float | DEFAULT_LOAD_FACTOR
The default load factor |
| private final Map | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CommonCache(final int
initial capacity of the cache initialCapacity, final int max size of the cache maxSize, final EvictableCache.LRU or FIFO, see evictionStrategyorg.Constructs a cache with limited size |
| public | CommonCache(int
initial capacity of the LRU cache initialCapacity, int max size of the LRU cache maxSize)Constructs a LRU cache with the specified initial capacity and max size. |
| public | CommonCache(final int
max size of the LRU cache maxSize)Constructs a LRU cache with the default initial capacity |
| public | CommonCache(Map<K, V>
the map)java. instanceConstructs a cache backed by the specified |
| Modifier and Type | Method and Description |
|---|---|
| public void | cleanUpNullReferences()
Implements org. |
| public Map | |
| public boolean | containsKey(Object
key whose presence in this cache is to be tested. key)Implements org. |
| public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. true if this map maps one or more keys to the
specified value.
|
| public Object | convertValue(V
the original value value)Implements org. |
| public Set | entrySet()
Implements java. Set view of the mappings contained in this map.
|
| public V | get(Object
the key whose associated value is to be returned key)Implements org. |
| public V | getAndPut(K key, MemoizeCache.
provide the value if the associated value not found valueProviderOverrides default org. |
| public V | getAndPut(K key, MemoizeCache.
|
| public boolean | |
| public Set | keys()
Implements org. |
| public Set | |
| public V | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Implements org. |
| public void | putAll(Map<? extends K, ? extends V>
mappings to be stored in this map m)Implements java. |
| public V | remove(Object
of the cached value key)Implements org. |
| public int | |
| public String | |
| public Collection |
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| public static final int DEFAULT_INITIAL_CAPACITY The default initial capacity | |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| public static final float DEFAULT_LOAD_FACTOR The default load factor | |
| map | back to summary |
|---|---|
| private final Map<K, V> map | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| CommonCache | back to summary |
|---|---|
| public CommonCache() Constructs a cache with unlimited size | |
| CommonCache | back to summary |
|---|---|
| public CommonCache(final int initialCapacity, final int maxSize, final EvictableCache. Constructs a cache with limited size
| |
| CommonCache | back to summary |
|---|---|
| public CommonCache(int initialCapacity, int maxSize) Constructs a LRU cache with the specified initial capacity and max size.
The LRU cache is slower than
| |
| CommonCache | back to summary |
|---|---|
| public CommonCache(final int maxSize) Constructs a LRU cache with the default initial capacity
| |
| CommonCache | back to summary |
|---|---|
| public CommonCache(Map<K, V> map) Constructs a cache backed by the specified
| |
| cleanUpNullReferences | back to summary |
|---|---|
| public void cleanUpNullReferences() Implements org. Doc from org. Invoked when some of the held SoftReferences have been evicted by the garbage collector and so should be removed from the cache. The implementation must ensure that concurrent invocations of all methods on the cache may occur from other threads and thus should protect any shared resources.
| |
| clearAll | back to summary |
|---|---|
| public Map Implements org. Doc from org. Clear the cache | |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(Object key) Implements org. Doc from org. Determines if the cache contains an entry for the specified key. | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Implements java. Doc from java. Returns | |
| convertValue | back to summary |
|---|---|
| public Object convertValue(V value) Implements org. Doc from org. convert the original value to the target value | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| get | back to summary |
|---|---|
| public V get(Object key) Implements org. Doc from org. Gets a value from the cache | |
| getAndPut | back to summary |
|---|---|
| public V getAndPut(K key, MemoizeCache. Overrides default org. Doc from org. Try to get the value from cache.
If not found, create the value by
| |
| getAndPut | back to summary |
|---|---|
| public V getAndPut(K key, MemoizeCache. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| keys | back to summary |
|---|---|
| public Set Implements org. Doc from org. Get all keys associated to cached values | |
| keySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| put | back to summary |
|---|---|
| public V put(K key, V value) Implements org. Doc from org. Associates the specified value with the specified key in the cache.
| |
| putAll | back to summary |
|---|---|
| public void putAll(Map<? extends K, ? extends V> m) Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling | |
| remove | back to summary |
|---|---|
| public V remove(Object key) Implements org. Doc from org. Remove the cached value by the key | |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. Get the size of the cache
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| values | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Get all cached values
| |