Class ArgsComparator
java.lang.Object
io.nosqlbench.virtdata.core.bindings.ArgsComparator
- All Implemented Interfaces:
Comparator<Constructor<?>>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(Constructor<?> o1, Constructor<?> o2) matchRank(Constructor<?> ctor, Object[] arguments) Establish a priority value (lower is better) based on how well the arguments match to the given constructor's parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ArgsComparator
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<Constructor<?>>
-
matchRank
Establish a priority value (lower is better) based on how well the arguments match to the given constructor's parameters. Note: The distinction between primitives and boxed types is lost here, as the primitive version of Classinvalid input: '<'?> is only accessible viaLong.TYPEand similar, so primitive matching and auto-boxed matching are effectively the same rank. rank 0 -> all arguments are the same type or boxed type rank 1 -> all arguments are assignable, without autoboxing rank 2 -> all arguments are assignable, with autoboxing rank 3 -> not all arguments are assignable- Parameters:
ctor- - constructorarguments- - arguments to match against- Returns:
- a lower number for when arguments match parameters better
-