| Modifier and Type | Field and Description |
|---|---|
| private final WeakHashMap | |
| private final ConcurrentHashMap | |
| private DoubleNode | |
| private DoubleNode | |
| private final boolean | |
| private final ReentrantLock | |
| private final ReferenceQueue | |
| private DoubleNode |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private DoubleNode | |
| public void | clear()
Implements org. Sets the clock size back to zero, no entries |
| public void | clearStaleReferences()
Implements org. Causes stale references to be cleared from the data structures. |
| public V | get(K key)
Implements org. Gets the given key, returning null if not found |
| public boolean | hasWeakKeys()
Implements org. Tells if this WeakHashClock has Weak keys |
| private DoubleNode | |
| private DoubleNode | |
| public Map. | next()
Implements org. Returns the next key/value pair in the clock, or null if the clock has no members. |
| public void | put(final K key, final V value)
Implements org. Adds the given pair to the clock. |
| public void | releaseMatching(CacheKeyFilter<K> filter)
Implements org. Releases all key/value pairs that match the filter |
| public V | remove(K key)
Implements org. Removes the given key from the clock, if found |
| private void | |
| private void | |
| public int | size()
Implements org. Returns the number of elements currently in the clock. |
| public String |
| byKey | back to summary |
|---|---|
| private final WeakHashMap<K, DoubleNode<K, V>> byKey | |
| byKeyNotWeak | back to summary |
|---|---|
| private final ConcurrentHashMap<K, DoubleNode<K, V>> byKeyNotWeak | |
| dot | back to summary |
|---|---|
| private DoubleNode<K, V> dot | |
| head | back to summary |
|---|---|
| private DoubleNode<K, V> head | |
| isWeak | back to summary |
|---|---|
| private final boolean isWeak | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock | |
| myQueue | back to summary |
|---|---|
| private final ReferenceQueue<? super K> myQueue | |
| tail | back to summary |
|---|---|
| private DoubleNode<K, V> tail | |
| WeakHashClockImpl | back to summary |
|---|---|
| public WeakHashClockImpl(boolean isWeak) | |
| addBeforeDot | back to summary |
|---|---|
| private DoubleNode | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Doc from org. Sets the clock size back to zero, no entries
| |
| clearStaleReferences | back to summary |
|---|---|
| public void clearStaleReferences() Implements org. Doc from org. 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) Implements org. Doc from org. Gets the given key, returning null if not found
| |
| hasWeakKeys | back to summary |
|---|---|
| public boolean hasWeakKeys() Implements org. Doc from org. Tells if this WeakHashClock has Weak keys
| |
| moveDot | back to summary |
|---|---|
| private DoubleNode | |
| moveDotNoWeak | back to summary |
|---|---|
| private DoubleNode | |
| next | back to summary |
|---|---|
| public Map. Implements org. Doc from org. 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(final K key, final V value) Implements org. Doc from org. 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) Implements org. Doc from org. Releases all key/value pairs that match the filter
| |
| remove | back to summary |
|---|---|
| public V remove(K key) Implements org. Doc from org. Removes the given key from the clock, if found
| |
| removeFromDLL | back to summary |
|---|---|
| private void removeFromDLL(DoubleNode<K, V> removeMe) | |
| removeStale | back to summary |
|---|---|
| private void removeStale() | |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. 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
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |