Class InverseComparator<T>

  • All Implemented Interfaces:
    Comparator<T>

    public class InverseComparator<T>
    extends Object
    implements Comparator<T>
    InverseComparator is a wrapper comparator which simply inverses the comparison result.
    Author:
    mf 2014.08.28
    • Field Detail

      • f_comparator

        protected final Comparator<T> f_comparator
        The comparator to invert.
      • INSTANCE

        public static final InverseComparator INSTANCE
        InverseComparator singleton which inverts a Comparable objects natural comparison order.
    • Constructor Detail

      • InverseComparator

        public InverseComparator​(Comparator<T> comparator)
        Construct an InverseComparator which inverts the specified comparator.
        Parameters:
        comparator - the comparator to invert