站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

CompoundIterator (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.collection
Class CompoundIterator

java.lang.Object
  extended byorg.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


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