Package org.apache.camel.support
Class GroupIterator
- java.lang.Object
-
- org.apache.camel.support.GroupIterator
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterator<Object>
public final class GroupIterator extends Object implements Iterator<Object>, Closeable
Group basedIterator
which groups the givenIterator
a number of times and then return a combined response as a List. This implementation uses a internal array list, to combine the response.- See Also:
GroupTokenIterator
-
-
Constructor Summary
Constructors Constructor Description GroupIterator(org.apache.camel.Exchange exchange, Iterator<?> it, int group)
Creates a new group iteratorGroupIterator(org.apache.camel.Exchange exchange, Iterator<?> it, int group, boolean skipFirst)
Creates a new group iterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
hasNext()
Object
next()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
GroupIterator
public GroupIterator(org.apache.camel.Exchange exchange, Iterator<?> it, int group)
Creates a new group iterator- Parameters:
exchange
- the exchange used to create this group iteratorit
- the iterator to groupgroup
- number of parts to group together- Throws:
IllegalArgumentException
- is thrown if group is not a positive number
-
GroupIterator
public GroupIterator(org.apache.camel.Exchange exchange, Iterator<?> it, int group, boolean skipFirst)
Creates a new group iterator- Parameters:
exchange
- the exchange used to create this group iteratorit
- the iterator to groupgroup
- number of parts to group together- Throws:
IllegalArgumentException
- is thrown if group is not a positive number
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-