Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.repo.cache
Interface SimpleCache<K extends Serializable,V>

public interface SimpleCache<K extends Serializable,V>
Basic caching interface.

All implementations must be thread-safe. Additionally, the use of the Serializable for both keys and values ensures that the underlying cache implementations can support both clustered caches as well as persistent caches.

All implementations must support null values. It therefore follows that

    (simpleCache.contains(key) == true) does not imply (simpleCache.get(key) != null)
 
but
    (simpleCache.contains(key) == false) implies (simpleCache.get(key) == null)
 
Author:
Derek Hulley

Method Summary
void
clear()
boolean
contains(K key)
get(K key)
getKeys()
void
put(K key, V value)
          Set the value to store for a given key.
void
remove(K key)
          Removes the cache entry whether or not the value stored against it is null.
Method Detail
contains
boolean contains(K key)
Parameters:
key - the cache key to check up on
Returns:
Returns true if there is a cache entry, regardless of whether the value itself is null

getKeys
Collection<KgetKeys()

get
V get(K key)
Parameters:
key - K
Returns:
Returns the value associated with the key. It will be null if the value is null or if the cache doesn't have an entry.

put
void put(K key,
         V value)
Set the value to store for a given key.

Be sure to use remove if cache entries need to be removed as the cache implementations must treat a null value as a first class object in exactly the same way as a Map will allow storage and retrieval of null values.

Parameters:
key - the key against which to store the value
value - the value to store. null is allowed.

remove
void remove(K key)
Removes the cache entry whether or not the value stored against it is null.
Parameters:
key - the key value to remove

clear
void clear()

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2016 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.