Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.util.collection
Class CompoundIterator

    java.lang.Object
      org.jboss.util.collection.CompoundIterator

All Implemented Interfaces:
  Iterator

public class CompoundIterator
extends Object
implements Iterator

A compound iterator, which iterates over all of the elements in the given iterators.

Version:
  `$Revision: 1.1 $`
Author:
  Jason Dillon

Field Summary
`protected int` | `index` The index of the current iterator.
`protected Iterator[]` | `iters` The array of iterators to iterate over.

Constructor Summary
`CompoundIterator(Iterator[] iters)` Construct a CompoundIterator over the given array of iterators.

Method Summary
`boolean` | `hasNext()` Check if there are more elements.
`Object` | `next()` Return the next element from the current iterator.
`void` | `remove()` Remove the current element from the current iterator.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### iters

    protected final Iterator[] iters

  The array of iterators to iterate over.

### index

    protected int index

  The index of the current iterator.

Constructor Detail

### CompoundIterator

    public CompoundIterator(Iterator[] iters)

  Construct a CompoundIterator over the given array of iterators.

Parameters:
  `iters` - Array of iterators to iterate over.
Throws:
  `IllegalArgumentException` - Array is null or empty.

Method Detail

### hasNext

    public boolean hasNext()

  Check if there are more elements.

  Specified by:
    `hasNext` in interface `Iterator`
  Returns:
    True if there are more elements.

### next

    public Object next()

  Return the next element from the current iterator.

  Specified by:
    `next` in interface `Iterator`
  Returns:
    The next element from the current iterator.
  Throws:
    `NoSuchElementException` - There are no more elements.

### remove

    public void remove()

  Remove the current element from the current iterator.

  Specified by:
    `remove` in interface `Iterator`
  Throws:
    `IllegalStateException`
    `UnsupportedOperationException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 JBoss Group, LLC. All Rights Reserved.