I
- type of inputO
- type of outputpublic interface UnaryComputerOp<I,O> extends UnaryOp<I,O>, NullaryComputerOp<O>
A unary computer may be treated as a NullaryComputerOp
by holding the
input constant.
UnaryFunctionOp
,
UnaryInplaceOp
SpecialOp.Flavor
Modifier and Type | Method and Description |
---|---|
void |
compute(I input,
O output)
Computes the output given some input.
|
default void |
compute(O output)
Computes the output value.
|
default UnaryComputerOp<I,O> |
getIndependentInstance()
Gets a reference to an instance of this object which can be used
simultaneously from a second thread while this instance is being used from
"its" thread.
|
default void |
run() |
default O |
run(I input,
O output)
Executes the operation in a type-safe but flexible way.
|
in, setInput
run
candidates, filterArity, op
ops, setEnvironment
initialize
setOutput
void compute(I input, O output)
input
- Argument to the computation, which must be non-nulloutput
- Object where the computation's result will be stored, which
must be non-null and a different object than input
default O run(I input, O output)
UnaryOp
The exact behavior depends on the type of special op.
run
in interface UnaryOp<I,O>
input
- argument to the operationoutput
- reference where the operation's result will be storedrun(Object, Object)
,
UnaryFunctionOp.run(Object, Object)
,
UnaryInplaceOp.run(Object, Object)
,
UnaryHybridCF.run(Object, Object)
default void compute(O output)
NullaryComputerOp
compute
in interface NullaryComputerOp<O>
output
- Object where the computation's result will be stored, which
must be non-nulldefault void run()
default UnaryComputerOp<I,O> getIndependentInstance()
Threadable
It is expected that subclasses which override this method will narrow the return type appropriately. We do not enforce this at compile time via recursive generics due to their complexity: they introduce a host of typing difficulties.
getIndependentInstance
in interface NullaryComputerOp<O>
getIndependentInstance
in interface NullaryOp<O>
getIndependentInstance
in interface SpecialOp
getIndependentInstance
in interface Threadable
getIndependentInstance
in interface UnaryOp<I,O>
Copyright © 2014–2022 ImageJ. All rights reserved.