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 Object
    Collection of static methods related with Comparators.
    Version:
    1.0
    Author:
    Ernst Reissner
    • Constructor Detail

      • Comparators

        public Comparators()
    • Method Detail

      • getAsListed

        public static <E> Comparator<E> getAsListed​(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:
        NullPointerException - if seq is null.