public class AggregatingIterator extends Object implements CloseableKeyIterator
CloseableIterator composite able to iterate over a set of
CloseableIterators. Elements are selected from composed iterators
so that they are iterated
in an ordered way.
In case an element with same id is found from different iterators, an
exception is thrown, unless
merge(Row, CloseableKeyIterator, Row, CloseableKeyIterator)
is overridden.| Constructor and Description |
|---|
AggregatingIterator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addIterator(CloseableKeyIterator it)
Adds an iterator to the list of iterators to be explored.
|
void |
close() |
boolean |
hasNext() |
Row |
merge(Row r1,
CloseableKeyIterator it1,
Row r2,
CloseableKeyIterator it2) |
Row |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic void addIterator(CloseableKeyIterator it)
IllegalStateException - in case the iteration has started using
hasNext() or next().public void close()
close in interface CloseableIterator<Row>close in interface Closeableclose in interface AutoCloseablepublic void remove()
remove in interface Iterator<Row>UnsupportedOperationException - in any casepublic Row merge(Row r1, CloseableKeyIterator it1, Row r2, CloseableKeyIterator it2) throws Exception
ExceptionCopyright © 2016. All Rights Reserved.