fr.inrialpes.exmo.align.impl
Class ConcatenatedIterator<O>
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
it1
private Iterator<O> it1
it2
private Iterator<O> it2
ConcatenatedIterator
public ConcatenatedIterator(Iterator<O> i1,
Iterator<O> i2)
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>
(C) INRIA & friends, 2003-2010