Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.util
Class AbstractStableIterator

`java.lang.Object
com.tangosol.util.Base
com.tangosol.util.AbstractStableIterator`

All Implemented Interfaces:
  Iterator

Direct Known Subclasses:
  AbstractKeySetBasedMap.KeyIterator, CompositeAddressProvider.AddressIterator, OverflowMap.EntrySet.EntrySetIterator, OverflowMap.InternalKeySet.InternalKeySetIterator, PartitionedIterator, PartitionSplittingBackingMap.PartitionedIterator, SafeHashMap.EntrySet.EntrySetIterator, SafeSortedMap.ViewMap.EntryIterator, SegmentedHashMap.EntrySet.EntrySetIterator

      public abstract class AbstractStableIterator

extends Base
implements Iterator

An abstract Iterator implementation that is stable between the `hasNext()` and `next()` methods, and between the `next()` and `remove()` methods.

Since:
  Coherence 3.1
Author:
  cp 2003.05.24

Constructor Summary
`AbstractStableIterator()` Default constructor.

Method Summary
`protected abstract void` | `advance()` Advance to the next object.
`protected Object` | `getPrevious()` Obtain the previous object provided by the Iterator.
`boolean` | `hasNext()` Returns `true` if the iteration has more elements.
`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` | `remove(Object oPrev)` Remove the specified item.
`protected void` | `setNext(Object oNext)` Specify the next object to provide from the Iterator.

Constructor Detail

### AbstractStableIterator

    public AbstractStableIterator()

  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 `Iterator`
  Returns:
    `true` if the iterator has more elements

### next

    public Object next()

  Returns the next element in the iteration.
  Specified by:
    `next` in interface `Iterator`
  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:
    `remove` in interface `Iterator`
  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

### getPrevious

    protected Object getPrevious()

  Obtain the previous object provided by the Iterator.
  Returns:
    the object previously returned from a call to `next()`

### setNext

    protected void setNext(Object oNext)

  Specify the next object to provide from the Iterator.
  Parameters:
    `oNext` - the next object to provide from the Iterator

### advance

    protected abstract void advance()

  Advance to the next object. <p/> This method must be implemented by the concrete sub-class by calling `setNext(java.lang.Object)` if there is a next object.

### remove

    protected void remove(Object oPrev)

  Remove the specified item. <p/> This is an optional operation. If the Iterator supports element removal, then it should implement this method, which is delegated to by the `remove()` method.
  Parameters:
    `oPrev` - the previously iterated object that should be removed
  Throws:
    `UnsupportedOperationException` - if removal is not supported

Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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