biz.hammurapi.dataflow
Class DataTypeMatcher

java.lang.Object
  extended by biz.hammurapi.dataflow.DataTypeMatcher
All Implemented Interfaces:
DataPipe, DataSink, DataSource

public class DataTypeMatcher
extends java.lang.Object
implements DataPipe

Converts source data items to match types declared. by the sink. Data items not declared by the sink are passed as-is.

Author:
Pavel

Constructor Summary
DataTypeMatcher()
           
 
Method Summary
 boolean addData(Data data)
          Adds data to the sink.
 boolean controlsMultiplexing()
           
 DataItemInfo[] getDataInfo()
           
 java.lang.String getName()
           
 void setSink(DataSink sink)
          Adds data sink to the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeMatcher

public DataTypeMatcher()
Method Detail

addData

public boolean addData(Data data)
Description copied from interface: DataSink
Adds data to the sink.

Specified by:
addData in interface DataSink
Returns:
true if data was "consumed" and shall be removed from further processing. If this sink is attached to a multiplexor, then the multiplexor shall not continue adding given data to "sibling" sinks.

controlsMultiplexing

public boolean controlsMultiplexing()
Specified by:
controlsMultiplexing in interface DataSink
Returns:
true if this sink controls multiplexing to "sibling" sinks, i.e. if addData() can return true.

getDataInfo

public DataItemInfo[] getDataInfo()
Specified by:
getDataInfo in interface DataSink
Returns:
Information about data items expected/required by the sink.

getName

public java.lang.String getName()
Specified by:
getName in interface DataSource

setSink

public void setSink(DataSink sink)
Description copied from interface: DataSource
Adds data sink to the source. Data source multiplexes data it produces to all sinks unless one of sinks returns true from addData(), which terminates multiplexing.

Specified by:
setSink in interface DataSource


Copyright © 2005 Hammurapi Group. All Rights Reserved.