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 IteratorEnumerator

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

All Implemented Interfaces:
  Enumeration, Iterator

      public class IteratorEnumerator

extends Base
implements Enumeration, Iterator

Provide a implementation of an enumerator based on data from an Iterator.

This has two main uses:

1. Turn Iterator interface into an Enumeration interface
2. Make an Iterator immutable

Version:
  1.00, 03/23/99
Author:
  Cameron Purdy

Constructor Summary
`IteratorEnumerator(Iterator iter)` Construct the enumerator based on an Iterator.

Method Summary
`boolean` | `hasMoreElements()` Tests if this enumeration contains more elements.
`boolean` | `hasNext()` Tests if this Iterator contains more elements.
`Object` | `next()` Returns the next element of this Iterator.
`Object` | `nextElement()` Returns the next element of this enumeration.
`void` | `remove()` Remove the last-returned element that was returned by the Iterator.

Constructor Detail

### IteratorEnumerator

    public IteratorEnumerator(Iterator iter)

  Construct the enumerator based on an Iterator.
  Parameters:
    `iter` - an Iterator

Method Detail

### hasMoreElements

    public boolean hasMoreElements()

  Tests if this enumeration contains more elements.
  Specified by:
    `hasMoreElements` in interface `Enumeration`
  Returns:
    true if the enumeration contains more elements, false otherwise

### nextElement

    public Object nextElement()

  Returns the next element of this enumeration.
  Specified by:
    `nextElement` in interface `Enumeration`
  Returns:
    the next element in the enumeration

### hasNext

    public boolean hasNext()

  Tests if this Iterator contains more elements.
  Specified by:
    `hasNext` in interface `Iterator`
  Returns:
    true if the Iterator contains more elements, false otherwise

### next

    public Object next()

  Returns the next element of this Iterator.
  Specified by:
    `next` in interface `Iterator`
  Returns:
    the next element in the Iterator

### remove

    public void remove()

  Remove the last-returned element that was returned by the Iterator. This method always throws UnsupportedOperationException because the Iterator is immutable.
  Specified by:
    `remove` in interface `Iterator`

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.