Package com.irurueta.sorting
Interface ComparatorAndAverager<T>
- Type Parameters:
T
- Type to be compared and averaged.
- All Superinterfaces:
Comparator<T>
This interface represents an object capable of comparing and averaging
instances of type T.
-
Method Summary
Methods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
average
Averages provided instances and returns an instance representing the average of provided ones. (i.e. if provided instances were doubles, then result would be 0.5 * (t1 + t2)).- Parameters:
t1
- Instance to be averaged.t2
- Instance to be averaged.- Returns:
- Instance representing average of provided ones.
-