jconch.pipeline.impl
Class CollectionProducer<T>
java.lang.Object
jconch.pipeline.PipelineStage
jconch.pipeline.Producer<T>
jconch.pipeline.impl.CollectionProducer<T>
public abstract class CollectionProducer<T>
- extends Producer<T>
A producer which provides elements from a given collection.
- Author:
- Robert Fischer
|
Method Summary |
Collection<T> |
getCollection()
Gets the collection backing the instance. |
protected boolean |
isExhausted()
Determines if the producer is done producing elements. |
T |
produceItem()
Method that must be implemented to queue the producer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionProducer
public CollectionProducer(Collection<T> data,
ThreadingModel model,
PipeLink<T> out)
- Constructor.
- Parameters:
data - The collection to draw elements from.
- Throws:
org.apache.commons.lang.NullArgumentException - If the argument is null
isExhausted
protected boolean isExhausted()
- Determines if the producer is done producing elements.
- Specified by:
isExhausted in class Producer<T>
- Returns:
- If the collection is empty.
produceItem
public T produceItem()
- Description copied from class:
Producer
- Method that must be implemented to queue the producer.
- Specified by:
produceItem in class Producer<T>
- Returns:
getCollection
public Collection<T> getCollection()
- Gets the collection backing the instance.