Package net.nuke24.tscript34.p0010.ducer
Class DucerState<I,O>
java.lang.Object
net.nuke24.tscript34.p0010.ducer.DucerState<I,O>
The state of a stream processor, including
queued-byt-not-yet-consumed input data, and output data.
Input and output may be independently closed.
Input may be closed before all data is consumed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal InputPortState<I>final DucerChunk<O>final Function<DucerChunk<I>,DucerState<I, O>> -
Constructor Summary
ConstructorsConstructorDescriptionDucerState(Function<DucerChunk<I>, DucerState<I, O>> processor, InputPortState<I> input, DucerChunk<O> output) -
Method Summary
Modifier and TypeMethodDescriptionDucerState<I,O> close()For use by internal processor.DucerState<I,O> For use by the internal processor.DucerState<I,O> For use by internal processor.booleanisDone()If true, that means that this Danducer has finished doing all the work it will ever do.DucerState<I,O> process(DucerChunk<I> input)
-
Field Details
-
processor
-
input
-
output
-
-
Constructor Details
-
DucerState
public DucerState(Function<DucerChunk<I>, DucerState<I, O>> processor, InputPortState<I> input, DucerChunk<O> output)
-
-
Method Details
-
process
-
isDone
public boolean isDone()If true, that means that this Danducer has finished doing all the work it will ever do. It will neither consume input nor generate output, so feel free to stop simulating it. -
closeInput
For use by the internal processor. To indicate end of input data, call process() with chunk that isEnd. Return a new state identical to this one but whose input port is closed. -
closeOutput
For use by internal processor. Return a new state identical to this one but whose input port is closed. -
close
For use by internal processor. Return a new state identical to this one but whose input and output ports are closed, which implies that this Danducer 'isDone'
-