Interface ComparatorAndAverager<T>

Type Parameters:
T - Type to be compared and averaged.
All Superinterfaces:
Comparator<T>

public interface ComparatorAndAverager<T> extends Comparator<T>
This interface represents an object capable of comparing and averaging instances of type T.
  • Method Details

    • average

      T average(T t1, T t2)
      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.