Class Comparables

java.lang.Object
org.midheaven.lang.Comparables

public class Comparables extends Object
Represents Comparables.
  • Method Details

    • compare

      public static <T extends Comparable<T>> int compare(T a, T b)
      Performs compare.
      Parameters:
      a - the a value
      b - the b value
      Returns:
      the result of compare
    • compare

      public static <T> int compare(Comparator<T> comparator, T a, T b)
      Performs compare.
      Parameters:
      comparator - the comparator value
      a - the a value
      b - the b value
      Returns:
      the result of compare
    • min

      public static <T extends Comparable<T>> T min(T a, T b, T... others)
      Performs min.
      Parameters:
      a - the a value
      b - the b value
      others - the others value
      Returns:
      the result of min
    • min

      public static <T> T min(Comparator<T> comparator, T a, T b, T... others)
      Performs min.
      Parameters:
      comparator - the comparator value
      a - the a value
      b - the b value
      others - the others value
      Returns:
      the result of min
    • min

      public static <T extends Comparable<T>> Maybe<T> min(Iterable<T> elements)
      Performs min.
      Parameters:
      elements - the elements value
      Returns:
      the result of min
    • min

      public static <T> Maybe<T> min(Comparator<T> comparator, Iterable<T> elements)
      Performs min.
      Parameters:
      comparator - the comparator value
      elements - the elements value
      Returns:
      the result of min
    • max

      public static <T extends Comparable<T>> T max(T a, T b, T... others)
      Performs max.
      Parameters:
      a - the a value
      b - the b value
      others - the others value
      Returns:
      the result of max
    • max

      public static <T> T max(Comparator<T> comparator, T a, T b, T... others)
      Performs max.
      Parameters:
      comparator - the comparator value
      a - the a value
      b - the b value
      others - the others value
      Returns:
      the result of max
    • max

      public static <T extends Comparable<T>> Maybe<T> max(Iterable<T> elements)
      Performs max.
      Parameters:
      elements - the elements value
      Returns:
      the result of max
    • max

      public static <T> Maybe<T> max(Comparator<T> comparator, Iterable<T> elements)
      Performs max.
      Parameters:
      comparator - the comparator value
      elements - the elements value
      Returns:
      the result of max