O
- type of outputpublic interface NullaryOp<O> extends SpecialOp, Output<O>
Nullary ops come in two major flavors: NullaryComputerOp
and
NullaryFunctionOp
. An additional hybrid type NullaryHybridCF
unions both flavors.
SpecialOp.Flavor
Modifier and Type | Method and Description |
---|---|
default int |
getArity()
Gets the op's number of special input parameters.
|
default NullaryOp<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() |
O |
run(O output)
Executes the operation in a type-safe but flexible way.
|
candidates, filterArity, op
ops, setEnvironment
initialize
O run(O output)
The exact behavior depends on the type of special op.
output
- reference where the operation's result will be storedNullaryComputerOp.run(Object)
,
NullaryFunctionOp.run(Object)
,
NullaryHybridCF.run(Object)
default int getArity()
SpecialOp
Note that this value may be larger than intuition might dictate in certain
scenarios, because UnaryOp
extends NullaryOp
, and
BinaryOp
extends UnaryOp
. This allows higher-order ops to
be treated as lower-order by holding the extra input parameters constant.
But it also means that e.g. a BinaryComputerOp
which is locally
typed as UnaryComputerOp
will report its arity as 2 rather than 1
as one might expect.
default NullaryOp<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 SpecialOp
getIndependentInstance
in interface Threadable
Copyright © 2014–2022 ImageJ. All rights reserved.