public interface WeakHashLRU<K>
Modifier and Type | Method and Description |
---|---|
void |
add(K key)
Adds the given key to the LRU.
|
void |
clear()
Removes all entries from this LRU
|
void |
clearStaleReferences()
Causes stale references to be cleared from the data
structures.
|
boolean |
contains(K key)
Tells if the given key is in the LRU
|
void |
releaseMatching(CacheKeyFilter<K> filter)
Releases all keys that match the filter
|
K |
remove()
Removes the key that was Least
Recently Used
|
boolean |
remove(K key)
Removes the given key from the LRU, if found
|
int |
size()
Returns the number of elements currently
in the clock.
|
void add(K key)
key
- Must not be nullboolean contains(K key)
key
- The key to search for, may not be nullboolean remove(K key)
key
- The key to remove, may not be nullvoid releaseMatching(CacheKeyFilter<K> filter)
filter
- A non-null filter that can be used
to delete every key that matches the filterint size()
K remove()
void clear()
void clearStaleReferences()
Copyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.