| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public boolean | Returns: true if found, false otherwiseThe key to search for, may not be null key)Tells if the given key is in the LRU |
| public void | releaseMatching(CacheKeyFilter<K>
A non-null filter that can be used
to delete every key that matches the filter filter)Releases all keys that match the filter |
| public boolean | Returns: true if removed, false otherwiseThe key to remove, may not be null key)Removes the given key from the LRU, if found |
| public K | Returns: The key that was removed, or null if the list is emptyRemoves the key that was Least Recently Used |
| public int | Returns: The number of entries currently in the LRUReturns the number of elements currently in the clock. |
| add | back to summary |
|---|---|
| public void add(K key) Adds the given key to the LRU. It will be placed at the MRU of the LRU. If this key already exists in the LRU it will be moved to the MRU
| |
| clear | back to summary |
|---|---|
| public void clear() Removes all entries from this LRU | |
| clearStaleReferences | back to summary |
|---|---|
| public void clearStaleReferences() Causes stale references to be cleared from the data structures. Since this is a weak clock the references can go away at any time, which happens whenever any operation has been performed. However, it may be the case that no operation will be performed for a while and so this method is provided to have a no-op operation to call in order to clear out any stale references | |
| contains | back to summary |
|---|---|
| public boolean contains(K key) Tells if the given key is in the LRU
| |
| releaseMatching | back to summary |
|---|---|
| public void releaseMatching(CacheKeyFilter<K> filter) Releases all keys that match the filter
| |
| remove | back to summary |
|---|---|
| public boolean remove(K key) Removes the given key from the LRU, if found
| |
| remove | back to summary |
|---|---|
| public K remove() Removes the key that was Least Recently Used
| |
| size | back to summary |
|---|---|
| public int size() Returns the number of elements currently in the clock. References that have gone away because they were weakly referenced will not be counted in the size
| |