public class LazyRemovalCache<K,V> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
LazyRemovalCache.Printable<K,V> |
Constructor and Description |
---|
LazyRemovalCache() |
LazyRemovalCache(int max_elements,
long max_age) |
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V val) |
void |
clear(boolean force) |
boolean |
containsKey(K key) |
boolean |
containsKeys(Collection<K> keys)
Returns true if all of the keys in keys are present.
|
Map<K,V> |
contents() |
V |
get(K key) |
K |
getByValue(V val) |
Set<V> |
nonRemovedValues()
Adds all value which have not been marked as removable to the returned set
|
String |
printCache() |
String |
printCache(LazyRemovalCache.Printable print_function) |
void |
remove(K key) |
void |
remove(K key,
boolean force) |
void |
removeAll(Collection<K> keys) |
void |
removeAll(Collection<K> keys,
boolean force) |
void |
removeMarkedElements()
Removes elements marked as removable
|
void |
removeMarkedElements(boolean force)
Removes elements marked as removable
|
void |
retainAll(Collection<K> keys) |
void |
retainAll(Collection<K> keys,
boolean force) |
int |
size() |
String |
toString() |
Set<V> |
values() |
public LazyRemovalCache()
public LazyRemovalCache(int max_elements, long max_age)
public boolean containsKey(K key)
public boolean containsKeys(Collection<K> keys)
public void remove(K key)
public void remove(K key, boolean force)
public void removeAll(Collection<K> keys)
public void removeAll(Collection<K> keys, boolean force)
public void clear(boolean force)
public void retainAll(Collection<K> keys)
public void retainAll(Collection<K> keys, boolean force)
public Set<V> nonRemovedValues()
public int size()
public String printCache()
public String printCache(LazyRemovalCache.Printable print_function)
public void removeMarkedElements(boolean force)
force
- If set to true, all elements marked as 'removable' will get removed, regardless of expirationpublic void removeMarkedElements()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.