org.apache.shindig.common.cache
Class NullCache<K,V>

java.lang.Object
  extended by org.apache.shindig.common.cache.NullCache<K,V>
All Implemented Interfaces:
Cache<K,V>

public class NullCache<K,V>
extends Object
implements Cache<K,V>

Cache implementation that does nothing.


Constructor Summary
NullCache()
           
 
Method Summary
 void addElement(K key, V value)
          Stores an entry into the cache.
 long getCapacity()
          Returns the capacity of the cache.
 V getElement(K key)
          Retrieves an entry for the cache.
 long getSize()
           
 V removeElement(K key)
          Removes an entry from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullCache

public NullCache()
Method Detail

addElement

public void addElement(K key,
                       V value)
Description copied from interface: Cache
Stores an entry into the cache.

Specified by:
addElement in interface Cache<K,V>

getCapacity

public long getCapacity()
Description copied from interface: Cache
Returns the capacity of the cache.

Specified by:
getCapacity in interface Cache<K,V>
Returns:
a positive integer indicating the upper bound on the number of allowed elements in the cace, -1 signifies that the capacity is unbounded

getElement

public V getElement(K key)
Description copied from interface: Cache
Retrieves an entry for the cache.

Specified by:
getElement in interface Cache<K,V>
Returns:
The entry stored under the given key, or null if it doesn't exist.

getSize

public long getSize()
Specified by:
getSize in interface Cache<K,V>
Returns:
The current size of the cache, or -1 if the cache does not support returning sizes.

removeElement

public V removeElement(K key)
Description copied from interface: Cache
Removes an entry from the cache.

Specified by:
removeElement in interface Cache<K,V>
Parameters:
key - The entry to return.
Returns:
The entry stored under the given key, or null if it doesn't exist.


Copyright © 2007-2012. All Rights Reserved.