polyglot.util
Class ConcatenatedIterator

java.lang.Object
  extended by polyglot.util.ConcatenatedIterator
All Implemented Interfaces:
java.util.Iterator

public final class ConcatenatedIterator
extends java.lang.Object
implements java.util.Iterator

ConcatenatedIterator Overview: This iterator wraps other iterators, and returns all their elements in order. Does not support Remove.


Field Summary
protected  java.util.Iterator[] backing_iterators
           
protected  int index
           
protected  java.lang.Object next_item
           
 
Constructor Summary
ConcatenatedIterator(java.util.Collection iters)
          Constructs a new ConcatenatedIterator which yields every element, in order, of every element of the collection iters, in order.
ConcatenatedIterator(java.util.Iterator[] iters)
          Constructs a new ConcatenatedIterator which yields every element, in order, of every element of the array iters, in order.
ConcatenatedIterator(java.util.Iterator iter1, java.util.Iterator iter2)
          Constructs a new ConcatenatedIterator which yields all of the elements of , followed by all the elements of .
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next_item

protected java.lang.Object next_item

backing_iterators

protected java.util.Iterator[] backing_iterators

index

protected int index
Constructor Detail

ConcatenatedIterator

public ConcatenatedIterator(java.util.Iterator iter1,
                            java.util.Iterator iter2)
Constructs a new ConcatenatedIterator which yields all of the elements of , followed by all the elements of .


ConcatenatedIterator

public ConcatenatedIterator(java.util.Iterator[] iters)
Constructs a new ConcatenatedIterator which yields every element, in order, of every element of the array iters, in order.


ConcatenatedIterator

public ConcatenatedIterator(java.util.Collection iters)
Constructs a new ConcatenatedIterator which yields every element, in order, of every element of the collection iters, in order.

Method Detail

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator