| Modifier and Type | Field and Description |
|---|---|
protected EvictionCallback |
callback |
protected java.util.Map<CacheKey,java.lang.Object> |
map |
protected int |
maxEntries |
| Constructor and Description |
|---|
DefaultCacheMap(int maxEntries) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from map.
|
boolean |
contains(CacheKey key)
Checks if map contains value for key specified.
|
protected void |
entryRemoved(java.util.Map.Entry<CacheKey,java.lang.Object> eldest) |
java.lang.Object |
get(CacheKey key)
Gets value associated with the key.
|
java.util.Collection<CacheKey> |
getAllKeys()
Returns all keys currently stored in this map.
|
long |
getCacheMaxEntries()
Returns max cache size above which eviction occurs.
|
java.lang.Object |
put(CacheKey key,
java.lang.Object value)
Puts new value into the map.
|
void |
registerEvictionCallback(EvictionCallback callback)
Notifies cache region when eviction occurs.
|
java.lang.Object |
remove(CacheKey key)
Removes value from the map.
|
long |
size()
Returns number of elements currently stored in the cache
|
protected final java.util.Map<CacheKey,java.lang.Object> map
protected final int maxEntries
protected EvictionCallback callback
public void registerEvictionCallback(EvictionCallback callback)
CacheMapregisterEvictionCallback in interface CacheMappublic java.lang.Object get(CacheKey key)
CacheMappublic java.lang.Object put(CacheKey key, java.lang.Object value)
CacheMappublic java.lang.Object remove(CacheKey key)
CacheMappublic boolean contains(CacheKey key)
CacheMappublic long getCacheMaxEntries()
CacheMapgetCacheMaxEntries in interface CacheMappublic void clear()
CacheMappublic long size()
CacheMappublic java.util.Collection<CacheKey> getAllKeys()
CacheMapgetAllKeys in interface CacheMapprotected void entryRemoved(java.util.Map.Entry<CacheKey,java.lang.Object> eldest)
Copyright © 2018 SAP SE. All Rights Reserved.