Class Comparators<E>

  • Type Parameters:
    E - the type to be compared. Created: Sat May 21 16:30:58 2005

    public abstract class Comparators<E>
    extends java.lang.Object
    Collection of static methods related with Comparators.
    Version:
    1.0
    Author:
    Ernst Reissner
    • Constructor Summary

      Constructors 
      Constructor Description
      Comparators()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> java.util.Comparator<E> getAsListed​(java.util.List<E> seq)
      Returns an ordering given by the list Comparators.AsListed.seq.
      static <E> java.util.Comparator<E> getCascade​(java.util.Collection<java.util.Comparator<E>> seq)  
      static <E> java.util.Comparator<E> getInv​(java.util.Comparator<E> cmp)  
      static <E> java.util.Comparator<E> getNegative​(java.util.Comparator<E> cmp)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Comparators

        public Comparators()
    • Method Detail

      • getNegative

        public static <E> java.util.Comparator<E> getNegative​(java.util.Comparator<E> cmp)
      • getInv

        public static <E> java.util.Comparator<E> getInv​(java.util.Comparator<E> cmp)
      • getCascade

        public static <E> java.util.Comparator<E> getCascade​(java.util.Collection<java.util.Comparator<E>> seq)
      • getAsListed

        public static <E> java.util.Comparator<E> getAsListed​(java.util.List<E> seq)
        Returns an ordering given by the list Comparators.AsListed.seq. Elements not in the list are all minimal and pairwise equal with respect to this comparator. They are less than all elements in the list. The ordering on the list is ascending.

        CAUTION: This ordering is consistent with equals only under certain conditions. The other ordering axioms hold. For more details see Comparators.AsListed.

        Caution: changing the list, affects the comparator.

        Parameters:
        seq - a list which determines the ordering.
        Throws:
        java.lang.NullPointerException - if seq is null.