Package com.tangosol.net.cache
Class SimpleOverflowMap.KeyIterator
java.lang.Object
com.tangosol.net.cache.SimpleOverflowMap.KeyIterator
- All Implemented Interfaces:
Iterator
- Enclosing class:
SimpleOverflowMap
An Iterator implementation that attempts to provide the most resilient
and most up-to-date view of the keys in the OverflowMap. This means
that it will avoid throwing a ConcurrentModificationException, and that
it will attempt to directly use the underlying iterators available for
the front and back maps.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanadvance()Advance to the next key.booleanhasNext()Returns true if the iteration has more elements.next()Returns the next element in the iteration.voidremove()Removes from the underlying collection the last element returned by the iterator.protected voidSwitch to an iterator over the back map.protected voidSwitch to an iterator over nothing.protected voidSwitch to a snapshot iterator.protected voidSwitch to a snapshot iterator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
KeyIterator
public KeyIterator()Default constructor.
-
-
Method Details
-
hasNext
public boolean hasNext()Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.) -
next
Returns the next element in the iteration.- Specified by:
nextin interfaceIterator- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException- if the Iterator has no more elements
-
remove
public void remove()Removes from the underlying collection the last element returned by the iterator.- Specified by:
removein interfaceIterator- Throws:
IllegalStateException- if the next method has not yet been called, or the remove method has already been called after the last call to the next method
-
advance
protected boolean advance()Advance to the next key.- Returns:
- true if there is a next key
-
useFrontIterator
protected void useFrontIterator()Switch to a snapshot iterator. -
useBackIterator
protected void useBackIterator()Switch to an iterator over the back map. -
useSnapshotIterator
protected void useSnapshotIterator()Switch to a snapshot iterator. -
useDoneIterator
protected void useDoneIterator()Switch to an iterator over nothing.
-