Package org.apache.wicket.markup
Class MarkupCache.DefaultCacheImplementation<K,V>
- java.lang.Object
-
- org.apache.wicket.markup.MarkupCache.DefaultCacheImplementation<K,V>
-
- Type Parameters:
K-V-
- All Implemented Interfaces:
MarkupCache.ICache<K,V>
- Enclosing class:
- MarkupCache
public static class MarkupCache.DefaultCacheImplementation<K,V> extends Object implements MarkupCache.ICache<K,V>
-
-
Constructor Summary
Constructors Constructor Description DefaultCacheImplementation()Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the cachebooleancontainsKey(Object key)Check if key is in the cacheVget(Object key)Get the cache element associated with the keyCollection<K>getKeys()Get all the keys referencing cache entriesCollection<V>getValues()Get all the values referencing cache entriesvoidput(K key, V value)Put an entry into the cachebooleanremove(K key)Remove an entry from the cache.voidshutdown()Cleanup and shutdownintsize()Get the number of cache entries
-
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:MarkupCache.ICacheClear the cache- Specified by:
clearin interfaceMarkupCache.ICache<K,V>
-
containsKey
public boolean containsKey(Object key)
Description copied from interface:MarkupCache.ICacheCheck if key is in the cache- Specified by:
containsKeyin interfaceMarkupCache.ICache<K,V>- Returns:
- true if cache contains key
key
-
get
public V get(Object key)
Description copied from interface:MarkupCache.ICacheGet the cache element associated with the key- Specified by:
getin interfaceMarkupCache.ICache<K,V>- Returns:
- cached object for key
keyor null if no matches
-
getKeys
public Collection<K> getKeys()
Description copied from interface:MarkupCache.ICacheGet all the keys referencing cache entries- Specified by:
getKeysin interfaceMarkupCache.ICache<K,V>- Returns:
- collection of cached keys
-
getValues
public Collection<V> getValues()
Description copied from interface:MarkupCache.ICacheGet all the values referencing cache entries- Specified by:
getValuesin interfaceMarkupCache.ICache<K,V>- Returns:
- collection of cached keys
-
put
public void put(K key, V value)
Description copied from interface:MarkupCache.ICachePut an entry into the cache- Specified by:
putin interfaceMarkupCache.ICache<K,V>- Parameters:
key- The reference key to find the element. Must not be null.value- The element to be cached. Must not be null.
-
remove
public boolean remove(K key)
Description copied from interface:MarkupCache.ICacheRemove an entry from the cache.- Specified by:
removein interfaceMarkupCache.ICache<K,V>- Returns:
- true, if found and removed
-
size
public int size()
Description copied from interface:MarkupCache.ICacheGet the number of cache entries- Specified by:
sizein interfaceMarkupCache.ICache<K,V>- Returns:
- number of cache entries
-
shutdown
public void shutdown()
Description copied from interface:MarkupCache.ICacheCleanup and shutdown- Specified by:
shutdownin interfaceMarkupCache.ICache<K,V>
-
-