Enum NumericComparisonType
- All Implemented Interfaces:
Serializable
,Comparable<NumericComparisonType>
Enumeration defining strategies for comparing numeric values when determining
the "best" score in analytical operations.
This enum encapsulates a Comparator
for Double
values, allowing
algorithms to determine whether the optimal value is the minimum or maximum score.
Each constant stores a comparator that defines the ordering for comparison.
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Comparator<Double>
Comparator to be used with max() function applied to a double stream. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NumericComparisonType
Returns the enum constant of this type with the specified name.static NumericComparisonType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
MAX
Selects the biggest numeric value as the best score. -
MIN
Selects the smallest numeric value as the best score.
-
-
Field Details
-
comparator
Comparator to be used with max() function applied to a double stream.
Usage Example:final double bestScore = comparableEntries.stream() .map(IEntryWithComparableNumericTuple::getBestMatchScore) .max(type.comparator)
-
-
Constructor Details
-
NumericComparisonType
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-