I- type of input
O- type of output
public interface UnaryOp<I,O> extends NullaryOp<O>, UnaryInput<I>
Unary ops come in three major flavors:
UnaryInplaceOp. Additional hybrid types
union these flavors in various combinations:
A unary op may be treated as a
NullaryOp by holding the input
|Modifier and Type||Method and Description|
Gets the op's number of special input parameters.
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.
Executes the operation in a type-safe but flexible way.
The exact behavior depends on the type of special op.
default int getArity()
Note that this value may be larger than intuition might dictate in certain
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
UnaryComputerOp will report its arity as 2 rather than 1
as one might expect.
default void run()
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.
Copyright © 2014–2019 ImageJ. All rights reserved.