jconch.pipeline.impl
Class CollectionConsumer<T>

java.lang.Object
  extended by jconch.pipeline.PipeStage
      extended by jconch.pipeline.Consumer<T>
          extended by 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

Constructor Summary
CollectionConsumer(java.util.Collection<T> out, ThreadingModel threading, PipeLink<T> in)
          Constructor.
CollectionConsumer(ThreadingModel threading, PipeLink<T> in)
           
 
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 jconch.pipeline.Consumer
execute, getLinkIn, isFinished
 
Methods inherited from class jconch.pipeline.PipeStage
getThreadingModel, isStarted, logMessage, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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.