public class MemoryCache extends java.lang.Object implements SimpleCache
HashMap
.
Note: This cache is not transaction- or thread-safe. Use it for single-threaded tests only.
Constructor and Description |
---|
MemoryCache() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(java.io.Serializable key) |
java.lang.Object |
get(java.io.Serializable key) |
java.util.Collection |
getKeys() |
void |
put(java.io.Serializable key,
java.lang.Object value) |
void |
remove(java.io.Serializable key)
Removes the cache entry whether or not the value stored against it is null.
|
public boolean contains(java.io.Serializable key)
contains
in interface SimpleCache
key
- the cache key to check up onpublic java.util.Collection getKeys()
getKeys
in interface SimpleCache
public java.lang.Object get(java.io.Serializable key)
get
in interface SimpleCache
public void put(java.io.Serializable key, java.lang.Object value)
put
in interface SimpleCache
key
- the key against which to store the valuevalue
- the value to store. null is allowed.public void remove(java.io.Serializable key)
SimpleCache
remove
in interface SimpleCache
key
- the key value to removepublic void clear()
clear
in interface SimpleCache
Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.