etomica.data
Class DataPump

java.lang.Object
  extended by etomica.data.DataProcessor
      extended by etomica.data.DataPump
All Implemented Interfaces:
IAction, DataPipe, IDataSink, Serializable
Direct Known Subclasses:
DataPumpListener

public class DataPump
extends DataProcessor
implements IAction

A DataProcessor whose action is to actively take Data from a DataSource and send it to DataSinks.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class etomica.data.DataProcessor
dataInfo, dataSink, tag, trueDataSink
 
Constructor Summary
DataPump(IEtomicaDataSource dataSource, IDataSink dataSink)
          Constructs DataPump with the given DataSource and DataSink.
 
Method Summary
 void actionPerformed()
          Transmits the data from the source to the sink.
 DataPipe getDataCaster(IEtomicaDataInfo incomingDataInfo)
          Returns null, indicating that this DataSink can handle any type of Data without casting.
 IEtomicaDataSource getDataSource()
           
 IData processData(IData inputData)
          Returns the given Data.
 IEtomicaDataInfo processDataInfo(IEtomicaDataInfo inputDataInfo)
          Returns the given DataInfo.
 
Methods inherited from class etomica.data.DataProcessor
getDataInfo, getDataSink, getTag, insertTransformerIfNeeded, putData, putDataInfo, setDataSink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataPump

public DataPump(IEtomicaDataSource dataSource,
                IDataSink dataSink)
Constructs DataPump with the given DataSource and DataSink. Data source cannot be null. Data sink can be null and must be identified via setDataSink if DataPump is to have any effect.

Method Detail

actionPerformed

public void actionPerformed()
Transmits the data from the source to the sink. Before transmitting the Data, this method will first check that the DataInfo from the source is the same as it was last time this method was invoked. If it has changed, a call to putDataInfo in the sink will be invoked before passing along the Data.

Specified by:
actionPerformed in interface IAction

processData

public IData processData(IData inputData)
Returns the given Data.

Specified by:
processData in class DataProcessor
Parameters:
inputData - the Data for processing
Returns:
the processed Data, for sending downstream (if not null)

processDataInfo

public IEtomicaDataInfo processDataInfo(IEtomicaDataInfo inputDataInfo)
Returns the given DataInfo.

Specified by:
processDataInfo in class DataProcessor
Returns:
the DataInfo of the Data that will be output by this DataProcessor

getDataCaster

public DataPipe getDataCaster(IEtomicaDataInfo incomingDataInfo)
Returns null, indicating that this DataSink can handle any type of Data without casting.

Specified by:
getDataCaster in interface IDataSink
Parameters:
incomingDataInfo - the DataInfo for the Data that will fed to the sink's putData method

getDataSource

public IEtomicaDataSource getDataSource()
Returns:
Returns the dataSource.