public final class GroupIterator extends Object implements Iterator<Object>, Closeable
Iterator
which groups the given Iterator
a number of times
and then return a combined response as a List.
This implementation uses a internal array list, to combine the response.GroupTokenIterator
Constructor and Description |
---|
GroupIterator(Exchange exchange,
Iterator<?> it,
int group)
Creates a new group iterator
|
GroupIterator(Exchange exchange,
Iterator<?> it,
int group,
boolean skipFirst)
Creates a new group iterator
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
hasNext() |
Object |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public GroupIterator(Exchange exchange, Iterator<?> it, int group)
exchange
- the exchange used to create this group iteratorit
- the iterator to groupgroup
- number of parts to group togetherIllegalArgumentException
- is thrown if group is not a positive numberpublic GroupIterator(Exchange exchange, Iterator<?> it, int group, boolean skipFirst)
exchange
- the exchange used to create this group iteratorit
- the iterator to groupgroup
- number of parts to group togetherIllegalArgumentException
- is thrown if group is not a positive numberpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Apache Camel