| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public V | Returns: The value found, or null if not foundThe key to search for, may not be null key)Gets the given key, returning null if not found |
| public boolean | Returns: true if this map has weak keys, true otherwiseTells if this WeakHashClock has Weak keys |
| public Map. | Returns: The next key/value pair in theReturns the next key/value pair in the clock, or null if the clock has no members. |
| public void | |
| public void | releaseMatching(CacheKeyFilter<K>
A non-null filter that can be used
to delete every key/value pair that matches the filter filter)Releases all key/value pairs that match the filter |
| public V | Returns: The value removed if found, or null if not foundThe key to remove, may not be null key)Removes the given key from the clock, if found |
| public int | Returns: The number of entries currently in the clockReturns the number of elements currently in the clock. |
| clear | back to summary |
|---|---|
| public void clear() Sets the clock size back to zero, no entries | |
| 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 | |
| get | back to summary |
|---|---|
| public V get(K key) Gets the given key, returning null if not found
| |
| hasWeakKeys | back to summary |
|---|---|
| public boolean hasWeakKeys() Tells if this WeakHashClock has Weak keys
| |
| next | back to summary |
|---|---|
| public Map. Returns the next key/value pair in the clock, or null if the clock has no members. This will advance the head and tail of the clock to the next element. If the WeakReference for the returned element is null then this element will also have been removed from the clock by this operation | |
| put | back to summary |
|---|---|
| public void put(K key, V value) Adds the given pair to the clock. It will be placed at the current tail of the clock
| |
| releaseMatching | back to summary |
|---|---|
| public void releaseMatching(CacheKeyFilter<K> filter) Releases all key/value pairs that match the filter
| |
| remove | back to summary |
|---|---|
| public V remove(K key) Removes the given key from the clock, if found
| |
| 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
| |