jconch.pipeline.impl
Class CollectionConsumer<T>
java.lang.Object
jconch.pipeline.PipeStage
jconch.pipeline.Consumer<T>
jconch.pipeline.impl.CollectionConsumer<T>
- All Implemented Interfaces:
- PipeElement
public abstract class CollectionConsumer<T>
- extends Consumer<T>
A consumer which collects elements into a collection.
- Author:
- Robert Fischer
|
Method Summary |
void |
consumeItem(T item)
Responsible for consuming items. |
java.util.Collection<T> |
getCollection()
Gets the collection backing the instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionConsumer
public CollectionConsumer(ThreadingModel threading,
PipeLink<T> in)
CollectionConsumer
public CollectionConsumer(java.util.Collection<T> out,
ThreadingModel threading,
PipeLink<T> in)
- Constructor.
- Parameters:
out - The collection to be populated.threading - The threading model to use.in - The pipeline link to draw from.
- Throws:
org.apache.commons.lang.NullArgumentException - If any argument is null
consumeItem
public void consumeItem(T item)
- Description copied from class:
Consumer
- Responsible for consuming items.
- Specified by:
consumeItem in class Consumer<T>
- Parameters:
item - The item to consume; never null
getCollection
public java.util.Collection<T> getCollection()
- Gets the collection backing the instance.