org.mule.routing.outbound
Class CollectionMessageSequence<T>

java.lang.Object
  extended by org.mule.routing.AbstractMessageSequence<T>
      extended by 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

Field Summary
 
Fields inherited from interface org.mule.routing.MessageSequence
UNKNOWN_SIZE
 
Constructor Summary
CollectionMessageSequence(Collection<T> collection)
           
 
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 org.mule.routing.AbstractMessageSequence
isEmpty, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionMessageSequence

public CollectionMessageSequence(Collection<T> collection)
Method Detail

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-2012 MuleSoft, Inc.. All Rights Reserved.