|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.blocks.LazyRemovalCache<K,V>
public class LazyRemovalCache<K,V>
Cache which doesn't remove elements on remove(), removeAll() or retainAll(), but only removes elements when a configurable size limit has been exceeded. In that case, all elements marked as removable and older than a configurable time are evicted. Elements are marked as removable by remove(), removeAll() and retainAll(). When an elements is marked as removable, but later reinserted, the mark is removed.
Nested Class Summary | |
---|---|
static interface |
LazyRemovalCache.Printable<K,V>
|
Constructor Summary | |
---|---|
LazyRemovalCache()
|
|
LazyRemovalCache(int max_elements,
long max_age)
|
Method Summary | |
---|---|
void |
add(K key,
V val)
|
void |
clear(boolean force)
|
boolean |
containsKey(K key)
|
boolean |
containsKeys(java.util.Collection<K> keys)
Returns true if all of the keys in keys are present. |
java.util.Map<K,V> |
contents()
|
V |
get(K key)
|
K |
getByValue(V val)
|
java.util.Set<V> |
nonRemovedValues()
Adds all value which have not been marked as removable to the returned set |
java.lang.String |
printCache()
|
java.lang.String |
printCache(LazyRemovalCache.Printable print_function)
|
void |
remove(K key)
|
void |
remove(K key,
boolean force)
|
void |
removeAll(java.util.Collection<K> keys)
|
void |
removeAll(java.util.Collection<K> keys,
boolean force)
|
void |
removeMarkedElements()
Removes elements marked as removable |
void |
removeMarkedElements(boolean force)
Removes elements marked as removable |
void |
retainAll(java.util.Collection<K> keys)
|
void |
retainAll(java.util.Collection<K> keys,
boolean force)
|
int |
size()
|
java.lang.String |
toString()
|
java.util.Set<V> |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LazyRemovalCache()
public LazyRemovalCache(int max_elements, long max_age)
Method Detail |
---|
public void add(K key, V val)
public boolean containsKey(K key)
public boolean containsKeys(java.util.Collection<K> keys)
public V get(K key)
public K getByValue(V val)
public void remove(K key)
public void remove(K key, boolean force)
public void removeAll(java.util.Collection<K> keys)
public void removeAll(java.util.Collection<K> keys, boolean force)
public void clear(boolean force)
public void retainAll(java.util.Collection<K> keys)
public void retainAll(java.util.Collection<K> keys, boolean force)
public java.util.Set<V> values()
public java.util.Set<V> nonRemovedValues()
public java.util.Map<K,V> contents()
public int size()
public java.lang.String printCache()
public java.lang.String printCache(LazyRemovalCache.Printable print_function)
public java.lang.String toString()
toString
in class java.lang.Object
public void removeMarkedElements(boolean force)
force
- If set to true, all elements marked as 'removable' will get removed, regardless of expirationpublic void removeMarkedElements()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |