public class LazyRemovalCache<K,V>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LazyRemovalCache.Entry<V> |
static interface |
LazyRemovalCache.Printable<K,V> |
Constructor and Description |
---|
LazyRemovalCache() |
LazyRemovalCache(int max_elements,
long max_age)
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(K key,
V val) |
void |
addAll(java.util.Map<K,V> m) |
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() |
java.util.Map<K,V> |
contents(boolean skip_removed_values) |
java.util.Set<java.util.Map.Entry<K,LazyRemovalCache.Entry<V>>> |
entrySet() |
V |
get(K key) |
K |
getByValue(V val) |
java.util.Set<K> |
keySet() |
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() |
java.lang.Iterable<LazyRemovalCache.Entry<V>> |
valuesIterator() |
public LazyRemovalCache()
public LazyRemovalCache(int max_elements, long max_age)
max_elements
- The max number of elements in the cachemax_age
- The max age (in ms) an entry can have before it is considered expired (and can be removed on
the next sweep)public java.util.Set<java.util.Map.Entry<K,LazyRemovalCache.Entry<V>>> entrySet()
public boolean containsKey(K key)
public boolean containsKeys(java.util.Collection<K> keys)
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<K> keySet()
public java.util.Set<V> values()
public java.lang.Iterable<LazyRemovalCache.Entry<V>> valuesIterator()
public java.util.Set<V> nonRemovedValues()
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()
Copyright © 1998-2020 Red Hat. All Rights Reserved.