- java.lang.Object
-
- org.scijava.ops.engine.matcher.impl.MatchingUtils
-
public final class MatchingUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMatchingUtils.TypeVarInfoMaintains info about aTypeVariable.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intisApplicable(Type[] args, Type[] params)Discerns whether it would be legal to pass a sequence of references of the given source types to a method with parameters typed according to the specified sequence of destination types.static intisApplicable(Type[] args, Type[] params, Map<TypeVariable<?>,MatchingUtils.TypeVarInfo> typeBounds)
-
-
-
Method Detail
-
isApplicable
public static int isApplicable(Type[] args, Type[] params)
Discerns whether it would be legal to pass a sequence of references of the given source types to a method with parameters typed according to the specified sequence of destination types.An example: suppose you have a method
<T extends Number> mergeLists(List<T> list1, List<T> list2). It is legal to pass twoList<Integer>instances to the method, but illegal to pass aList<Integer>andList<Double>becauseTcannot be bothIntegerandDoublesimultaneously.- Parameters:
args-params-- Returns:
- -1 if the args satisfy the params, otherwise the index of the arg that does not satisfy its parameter.
-
isApplicable
public static int isApplicable(Type[] args, Type[] params, Map<TypeVariable<?>,MatchingUtils.TypeVarInfo> typeBounds)
-
-