Class NaturalOrderComparator<T extends java.lang.Comparable<T>>

  • All Implemented Interfaces:
    java.util.Comparator<T>

    public final class NaturalOrderComparator<T extends java.lang.Comparable<T>>
    extends java.lang.Object
    implements java.util.Comparator<T>

    Simple Comparator implementation which can be used for Comparable objects.

    Since:
    2.3
    Version:
    2.5
    Author:
    Michael Grove
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(T o1, T o2)
      static <T extends java.lang.Comparable<T>>
      NaturalOrderComparator<T>
      create()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Method Detail

      • compare

        public int compare​(T o1,
                           T o2)
        Specified by:
        compare in interface java.util.Comparator<T extends java.lang.Comparable<T>>