public class PartitionedMessageSequence<Q> extends Object implements MessageSequence<Collection<Q>>
MessageSequence
wrapper that partitions the wrapped sequence in
collections of the specified size.UNKNOWN_SIZE
Constructor and Description |
---|
PartitionedMessageSequence(MessageSequence<Q> seq,
int groupSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Whether this sequence has more elements.
|
boolean |
isEmpty()
If the sequence is empty
|
Collection<Q> |
next()
The next element of the sequence.
|
void |
remove()
Unsupported operation.
|
int |
size()
The number of members of the sequence.
|
public PartitionedMessageSequence(MessageSequence<Q> seq, int groupSize)
public int size()
MessageSequence
size
in interface MessageSequence<Collection<Q>>
MessageSequence.UNKNOWN_SIZE
,
if it is unknownpublic boolean hasNext()
MessageSequence
hasNext
in interface Iterator<Collection<Q>>
hasNext
in interface MessageSequence<Collection<Q>>
Iterator.hasNext()
public Collection<Q> next()
MessageSequence
MessageSequence.size()
is not equal to
MessageSequence.UNKNOWN_SIZE
, this means that this method may be invoked
approximately up to MessageSequence.size()
times.next
in interface Iterator<Collection<Q>>
next
in interface MessageSequence<Collection<Q>>
public boolean isEmpty()
MessageSequence
isEmpty
in interface MessageSequence<Collection<Q>>
public void remove()
MessageSequence
MessageSequence
do not allow removal of elements.remove
in interface Iterator<Collection<Q>>
remove
in interface MessageSequence<Collection<Q>>
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.