- java.lang.Object
-
- org.scijava.ops.engine.matcher.convert.Conversions
-
public final class Conversions extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intmutableIndexOf(Type t)static Optional<ConvertedOpInfo>tryConvert(OpEnvironment env, OpInfo info, OpRequest request)
-
-
-
Method Detail
-
mutableIndexOf
public static int mutableIndexOf(Type t)
Finds theMutableorContainerargument of aFunctionalInterface's singular abstract method. If there is no argument annotated withMutableorContainer, then it is assumed that no arguments are mutable and that the output of the functionalMethodis its output. We also assume that only one argument is annotated.- Parameters:
t- - theTypeextending aFunctionalInterface- Returns:
- the index of the mutable argument (or -1 iff the output is returned).
-
tryConvert
public static Optional<ConvertedOpInfo> tryConvert(OpEnvironment env, OpInfo info, OpRequest request)
Tries to convert anOpInfo, such that its parameter types match the argument types of a givenOpRequest.- Parameters:
env- theOpEnvironmentused for creating conversionsinfo- theOpInfoto convertrequest- theOpRequestdefining the needed I/O types.- Returns:
- a
ConvertedOpInfo, if the conversion is possible.
-
-