IN
- The type of input value.OUT
- The type of output value.public class ThreadNode<IN,OUT> extends Node<IN,OUT>
ThreadNode
implements a Node
that can be used to transfer execution to a worker
Thread
or to main Thread
.graph, inputNodes
Constructor and Description |
---|
ThreadNode()
Constructs a new instance of
ThreadNode . |
ThreadNode(boolean executeInMainThread)
Constructs a new instance of
ThreadNode for transferring the execution to main or
background Thread depending on the given boolean flag. |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the worker
Thread . |
void |
doOnReset()
Invoked by
InputNode.onCompleted(OutputNode) . |
void |
emitOutput()
Invoked to emit available output value(s) from this
OutputNode . |
protected void |
emitOutput(OUT output)
Invoked to emit the given output to attached
InputNode s, if any. |
protected OUT |
processInput(OutputNode<IN> outputNode,
IN input)
Invoked by
InputNode.onInput(OutputNode, Object) when the given input Object
has been received from the OutputNode that emitted it. |
action, action, addInputNode, attach, begin, begin, beginTimer, beginTimer, buffer, completed, concat, concatStrings, count, createErrorMessage, detach, dispatchError, dispatchReset, distinct, doOnCompleted, doOnError, doOnInput, filter, first, first, getGraph, hasInputNodes, isErrorReceived, last, last, map, merge, nth, observer, observer, onAttached, onCompleted, onDetached, onError, onInput, onReset, removeInputNode, repeat, reverse, setErrorReceived, setGraph, skip, skipWhile, start, string, sum, take, timer, timer, toBoolean, toByte, toChar, toDouble, toFloat, toInt, toLong, toMain, toShort, toWorker, whenClicked, whenTextChanged
public ThreadNode()
ThreadNode
.public ThreadNode(boolean executeInMainThread)
ThreadNode
for transferring the execution to main or
background Thread
depending on the given boolean flag.executeInMainThread
- A boolean
flag.public void cancel()
Thread
.public void emitOutput()
OutputNode
OutputNode
.emitOutput
in interface OutputNode<OUT>
emitOutput
in class Node<IN,OUT>
protected OUT processInput(OutputNode<IN> outputNode, IN input)
Node
InputNode.onInput(OutputNode, Object)
when the given input Object
has been received from the OutputNode
that emitted it.processInput
in class Node<IN,OUT>
outputNode
- An OutputNode
that emitted the input.input
- The input Object
.protected void emitOutput(OUT output)
Node
InputNode
s, if any.emitOutput
in class Node<IN,OUT>
output
- The outbut Object
.