public class ConcurrentEntryIterator<K,V> extends Object implements Iterator<Entry<K,V>>
Hash expansion: During the iteration a hash expansion may happen, which means every entry is rehashed. In this case it is most likely that entries are missed. If an expansion occurred, the iteration will restart from the beginning. To ensure that every entry is only iterated once, the iterator has an internal bookkeeping, what was previously iterated.
Clear: A clear operation stops current iterations.
Close: A close operation will stop the iteration and yield a CacheClosedException
Constructor and Description |
---|
ConcurrentEntryIterator(HeapCache<K,V> _cache) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasBeenIterated(K key,
int _hashCode)
Used by the storage code to filter out already iterated keys
|
boolean |
hasNext() |
void |
markIterated(K key,
int _hashCode)
Mark the key as returned by the iteration to suppress doubled iterations when we
need to scan throw twice ore more, e.g.
|
Entry<K,V> |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public boolean hasBeenIterated(K key, int _hashCode)
public void markIterated(K key, int _hashCode)
key
- key object_hashCode
- corresponding modified hash, unused but we keep it if we want to switch to
a more efficient hash tablecache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.