Interface WeakHashClock<K,V>

This is a clock (if non-empty the next verb will always return a new value
in a cycle) that can also get values in O(1) complexity. This HashClock
also has Weak key references, so if the key becomes unavailable it
will not be retrievable from the get operation and the next operation
will remove it from the clock

next

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

Returns:

The next key/value pair in the

clear

void clear()

Sets the clock size back to zero, no entries

clearStaleReferences

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