Alignment API and Server 4.1.${version.update}

fr.inrialpes.exmo.align.impl
Class ConcatenatedIterator<O>

java.lang.Object
  extended by fr.inrialpes.exmo.align.impl.ConcatenatedIterator<O>
All Implemented Interfaces:
Iterable<O>, Iterator<O>

public final class ConcatenatedIterator<O>
extends Object
implements Iterator<O>, Iterable<O>

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 899 2009-01-11 12:47:29Z euzenat $
Author:
Jérôme Euzenat

Field Summary
private  Iterator<O> it1
           
private  Iterator<O> it2
           
 
Constructor Summary
ConcatenatedIterator(Iterator<O> i1, Iterator<O> i2)
           
 
Method Summary
 boolean hasNext()
           
 Iterator<O> iterator()
           
 O 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<O> it1

it2

private Iterator<O> it2
Constructor Detail

ConcatenatedIterator

public ConcatenatedIterator(Iterator<O> i1,
                            Iterator<O> i2)
Method Detail

hasNext

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

next

public O next()
       throws NoSuchElementException
Specified by:
next in interface Iterator<O>
Throws:
NoSuchElementException

remove

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

iterator

public Iterator<O> iterator()
Specified by:
iterator in interface Iterable<O>

Alignment API and Server 4.1.${version.update}

(C) INRIA & friends, 2003-${curryear}