org.mule.routing.outbound
Class CollectionMessageSequence<T>
java.lang.Object
org.mule.routing.AbstractMessageSequence<T>
org.mule.routing.outbound.CollectionMessageSequence<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
- Iterator<T>, MessageSequence<T>
public final class CollectionMessageSequence<T>
- extends AbstractMessageSequence<T>
A MessageSequence
that retrieves elements from a Collection
. Its
estimated size is initially the size of the collection, and decreases when
elements are consumed using next()
- Author:
- flbulgarelli
Method Summary |
boolean |
hasNext()
Whether this sequence has more elements. |
T |
next()
The next element of the sequence. |
int |
size()
The number of members of the sequence. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionMessageSequence
public CollectionMessageSequence(Collection<T> collection)
size
public int size()
- Description copied from interface:
MessageSequence
- The number of members of the sequence. If this is unknown, return UNKNOWN_ELEMENTS_COUNT.
- Returns:
- The estimated size of the sequence, or
MessageSequence.UNKNOWN_SIZE
,
if it is unknown
hasNext
public boolean hasNext()
- Description copied from interface:
MessageSequence
- Whether this sequence has more elements.
- See Also:
Iterator.hasNext()
next
public T next()
- Description copied from interface:
MessageSequence
- The next element of the sequence. At any moment, if
MessageSequence.size()
is not equal to
MessageSequence.UNKNOWN_SIZE
, this means that this method may be invoked
approximately up to MessageSequence.size()
times.
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.