org.apache.wicket.markup
Class MarkupCache.DefaultCacheImplementation<K,V>

java.lang.Object
  extended by 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
MarkupCache.DefaultCacheImplementation()
          Construct.
 
Method Summary
 void clear()
          Clear the cache
 boolean containsKey(Object key)
          Check if key is in the cache
 V get(Object key)
          Get the cache element associated with the key
 Collection<K> getKeys()
          Get all the keys referencing cache entries
 void put(K key, V value)
          Put an entry into the cache
 boolean remove(K key)
          Remove an entry from the cache.
 void shutdown()
          Cleanup and shutdown
 int size()
          Get the number of cache entries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkupCache.DefaultCacheImplementation

public MarkupCache.DefaultCacheImplementation()
Construct.

Method Detail

clear

public void clear()
Clear the cache

Specified by:
clear in interface MarkupCache.ICache<K,V>

containsKey

public boolean containsKey(Object key)
Check if key is in the cache

Specified by:
containsKey in interface MarkupCache.ICache<K,V>
Returns:
true if cache contains key key

get

public V get(Object key)
Get the cache element associated with the key

Specified by:
get in interface MarkupCache.ICache<K,V>
Returns:
cached object for key key or null if no matches

getKeys

public Collection<K> getKeys()
Get all the keys referencing cache entries

Specified by:
getKeys in interface MarkupCache.ICache<K,V>
Returns:
collection of cached keys

put

public void put(K key,
                V value)
Put an entry into the cache

Specified by:
put in interface MarkupCache.ICache<K,V>
Parameters:
key - The reference key to find the element
value - The element to be cached

remove

public boolean remove(K key)
Remove an entry from the cache.

Specified by:
remove in interface MarkupCache.ICache<K,V>
Returns:
true, if found and removed

size

public int size()
Get the number of cache entries

Specified by:
size in interface MarkupCache.ICache<K,V>
Returns:
number of cache entries

shutdown

public void shutdown()
Cleanup and shutdown

Specified by:
shutdown in interface MarkupCache.ICache<K,V>


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.