Package com.irurueta.sorting
Interface ComparableAndAverageable<T>
- Type Parameters:
T
- Type to be compared and averaged
- All Superinterfaces:
Comparable<T>
Interface for objects that can be compared and averaged with other objects.
-
Method Summary
Modifier and TypeMethodDescriptionaverageWith
(T other) Averages current instance with another instance.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
averageWith
Averages current instance with another instance. (i.e. if both objects where Doubles, then the result would be equal to 0.5 * (obj1 + obj2)).- Parameters:
other
- Other instance to be averaged with.- Returns:
- An instance representing the average of both instances.
-