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 void
clear()
Clear the cacheboolean
containsKey(Object key)
Check if key is in the cacheV
get(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 entriesvoid
put(K key, V value)
Put an entry into the cacheboolean
remove(K key)
Remove an entry from the cache.void
shutdown()
Cleanup and shutdownint
size()
Get the number of cache entries
-
-
-
Constructor Detail
-
DefaultCacheImplementation
public DefaultCacheImplementation()
Construct.
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:MarkupCache.ICache
Clear the cache- Specified by:
clear
in interfaceMarkupCache.ICache<K,V>
-
containsKey
public boolean containsKey(Object key)
Description copied from interface:MarkupCache.ICache
Check if key is in the cache- Specified by:
containsKey
in interfaceMarkupCache.ICache<K,V>
- Returns:
- true if cache contains key
key
-
get
public V get(Object key)
Description copied from interface:MarkupCache.ICache
Get the cache element associated with the key- Specified by:
get
in interfaceMarkupCache.ICache<K,V>
- Returns:
- cached object for key
key
or null if no matches
-
getKeys
public Collection<K> getKeys()
Description copied from interface:MarkupCache.ICache
Get all the keys referencing cache entries- Specified by:
getKeys
in interfaceMarkupCache.ICache<K,V>
- Returns:
- collection of cached keys
-
getValues
public Collection<V> getValues()
Description copied from interface:MarkupCache.ICache
Get all the values referencing cache entries- Specified by:
getValues
in interfaceMarkupCache.ICache<K,V>
- Returns:
- collection of cached keys
-
put
public void put(K key, V value)
Description copied from interface:MarkupCache.ICache
Put an entry into the cache- Specified by:
put
in 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.ICache
Remove an entry from the cache.- Specified by:
remove
in interfaceMarkupCache.ICache<K,V>
- Returns:
- true, if found and removed
-
size
public int size()
Description copied from interface:MarkupCache.ICache
Get the number of cache entries- Specified by:
size
in interfaceMarkupCache.ICache<K,V>
- Returns:
- number of cache entries
-
shutdown
public void shutdown()
Description copied from interface:MarkupCache.ICache
Cleanup and shutdown- Specified by:
shutdown
in interfaceMarkupCache.ICache<K,V>
-
-