Interface ComparableAndAverageable<T>

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

public interface ComparableAndAverageable<T> extends Comparable<T>
Interface for objects that can be compared and averaged with other objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    averageWith(T other)
    Averages current instance with another instance.

    Methods inherited from interface java.lang.Comparable

    compareTo
  • Method Details

    • averageWith

      T averageWith(T other)
      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.