Class DescendingComparer

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Comparator

    public class DescendingComparer
    extends java.lang.Object
    implements java.util.Comparator, java.io.Serializable
    A Comparer used for comparing descending keys. This simply returns the inverse of the result delivered by the base comparer.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      DescendingComparer​(java.util.Comparator base)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object a, java.lang.Object b)
      Compare two objects.
      • 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
    • Constructor Detail

      • DescendingComparer

        public DescendingComparer​(java.util.Comparator base)
    • Method Detail

      • compare

        public int compare​(java.lang.Object a,
                           java.lang.Object b)
        Compare two objects.
        Specified by:
        compare in interface java.util.Comparator
        Returns:
        <0 if a0 if a>b
        Throws:
        java.lang.ClassCastException - if the objects are of the wrong type for this Comparer