Alignment API and Server 3.5

fr.inrialpes.exmo.align.impl
Class ConcatenatedIterator

java.lang.Object
  extended by fr.inrialpes.exmo.align.impl.ConcatenatedIterator
All Implemented Interfaces:
Iterator

public final class ConcatenatedIterator
extends Object
implements Iterator

This class builds a composite iterator from two iterators This helps writing more concise code. This is the naive implementation (can be optimized)

Version:
$Id: ConcatenatedIterator.java 690 2008-03-31 10:26:08Z euzenat $
Author:
Jérôme Euzenat

Field Summary
private  Iterator it1
           
private  Iterator it2
           
 
Constructor Summary
ConcatenatedIterator(Iterator i1, Iterator i2)
           
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

it1

private Iterator it1

it2

private Iterator it2
Constructor Detail

ConcatenatedIterator

public ConcatenatedIterator(Iterator i1,
                            Iterator i2)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
            throws NoSuchElementException
Specified by:
next in interface Iterator
Throws:
NoSuchElementException

remove

public void remove()
            throws UnsupportedOperationException
Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException

Alignment API and Server 3.5

(C) INRIA & friends, 2003-2008