Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.net.cache
Class SimpleOverflowMap.KeyIterator

java.lang.Object
  extended by com.tangosol.net.cache.SimpleOverflowMap.KeyIterator

All Implemented Interfaces:
java.util.Iterator
Enclosing class:
SimpleOverflowMap

protected class SimpleOverflowMap.KeyIterator
extends java.lang.Object
implements java.util.Iterator

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
SimpleOverflowMap.KeyIterator()
          Default constructor.

 

Method Summary
protected  boolean advance()
          Advance to the next key.
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void remove()
          Removes from the underlying collection the last element returned by the iterator.
protected  void useBackIterator()
          Switch to an iterator over the back map.
protected  void useDoneIterator()
          Switch to an iterator over nothing.
protected  void useFrontIterator()
          Switch to a snapshot iterator.
protected  void useSnapshotIterator()
          Switch to a snapshot iterator.

 

Constructor Detail

SimpleOverflowMap.KeyIterator

public SimpleOverflowMap.KeyIterator()
Default constructor.

Method Detail

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.)
Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements

next

public java.lang.Object next()
Returns the next element in the iteration.
Specified by:
next in interface java.util.Iterator
Returns:
the next element in the iteration
Throws:
java.util.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:
remove in interface java.util.Iterator
Throws:
java.lang.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.

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.