T
- type of datapublic abstract static class Data.Sink<T> extends Object implements org.praxislive.core.Lookup.Provider
@Inject Sink<TYPE> sink;
to create a sink.
By default the pass the same instance of T through the pipe graph. To
create new type T, accumulate values, validate values, etc. provide the
related functions.
Use input() to get a Data.Pipe to link to the sink.
Use process() every time you want to process a graph of T.Constructor and Description |
---|
Sink() |
Modifier and Type | Method and Description |
---|---|
Data.Pipe<T> |
input()
Get the input pipe for this sink.
|
Data.Sink<T> |
onAccumulate(BinaryOperator<T> accumulator) |
Data.Sink<T> |
onClear(UnaryOperator<T> clearer)
Function to clear an instance of T when required, at the head of a
pipe chain, prior to accumulation, etc.
|
Data.Sink<T> |
onCreate(UnaryOperator<T> creator)
Function to get an instance of T when a new data packet is being
created.
|
Data.Sink<T> |
onValidate(BiPredicate<T,T> validator)
Function to validate a source Data.Packet value against a destination
Data.Packet value.
|
T |
process(T data)
Process an instance of type T through the data graph.
|
void |
reset()
Reset all functions and disconnect all sources.
|
public void reset()
public Data.Pipe<T> input()
public T process(T data)
data
- instance of T to processpublic Data.Sink<T> onCreate(UnaryOperator<T> creator)
creator
- function to get an instance of Tpublic Data.Sink<T> onClear(UnaryOperator<T> clearer)
clearer
- function to clear an instance of Tpublic Data.Sink<T> onAccumulate(BinaryOperator<T> accumulator)
public Data.Sink<T> onValidate(BiPredicate<T,T> validator)
validator
- function to validate source T against destination T