Class Comparables


  • public class Comparables
    extends Object
    Utilities for Comparable classes.
    Author:
    hakon
    • Constructor Detail

      • Comparables

        public Comparables()
    • Method Detail

      • min

        public static <T extends Comparable<? super T>> T min​(T first,
                                                              T second)
        Returns the least element, or first if they are equal according to compareTo.
      • max

        public static <T extends Comparable<? super T>> T max​(T first,
                                                              T second)
        Returns the least element, or second if they are equal according to compareTo.