JUtil

net.cscott.jutil
Class CombineIterator<E>

java.lang.Object
  extended by net.cscott.jutil.CombineIterator<E>
All Implemented Interfaces:
Iterator<E>

public class CombineIterator<E>
extends Object
implements Iterator<E>

A CombineIterator combines several different Iterators into one.

Version:
$Id: CombineIterator.java,v 1.4 2006-10-30 19:58:05 cananian Exp $
Author:
C. Scott Ananian

Constructor Summary
CombineIterator(Iterator<E> i1, Iterator<E> i2)
          Creates a CombineIterator from a pair of Iterators.
CombineIterator(Iterator<E> i1, Iterator<E> i2, Iterator<E> i3)
          Creates a CombineIterator from three Iterators.
CombineIterator(Iterator<Iterator<E>> it)
          Creates a CombineIterator from an Iterator over Iterators.
CombineIterator(List<Iterator<E>> itl)
          Creates a CombineIterator from an array of Iterators.
 
Method Summary
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombineIterator

public CombineIterator(List<Iterator<E>> itl)
Creates a CombineIterator from an array of Iterators.


CombineIterator

public CombineIterator(Iterator<E> i1,
                       Iterator<E> i2)
Creates a CombineIterator from a pair of Iterators.


CombineIterator

public CombineIterator(Iterator<E> i1,
                       Iterator<E> i2,
                       Iterator<E> i3)
Creates a CombineIterator from three Iterators.


CombineIterator

public CombineIterator(Iterator<Iterator<E>> it)
Creates a CombineIterator from an Iterator over Iterators.

Method Detail

next

public E next()
Specified by:
next in interface Iterator<E>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>

remove

public void remove()
Specified by:
remove in interface Iterator<E>

JUtil

Copyright (c) 2006 C. Scott Ananian