Class ElementOrderMethod<T>

  • Type Parameters:
    T - the element type
    All Implemented Interfaces:
    Serializable

    public class ElementOrderMethod<T>
    extends Object
    implements Serializable
    Represents the method of ensuring the existence of a total order of a set of elements.
    Author:
    Dimitrios Michail
    See Also:
    Serialized Form
    • Method Detail

      • natural

        public static <T> ElementOrderMethod<T> natural()
        Get the natural ordering method
        Type Parameters:
        T - the element type
        Returns:
        the natural ordering method
      • internal

        public static <T> ElementOrderMethod<T> internal()
        Get the internal ordering method. This represents the method of explicitly maintaining a map from the elements to long integers. Thus, it incurs a penalty in space and in lookups.
        Type Parameters:
        T - the element type
        Returns:
        the internal ordering method
      • comparator

        public static <T> ElementOrderMethod<T> comparator​(Comparator<T> comparator)
        Get the comparator ordering method.
        Type Parameters:
        T - the element type
        Parameters:
        comparator - the actual comparator
        Returns:
        the comparator ordering method
      • guavaComparator

        public static <T> ElementOrderMethod<T> guavaComparator()
        Get the guava comparator ordering method.
        Type Parameters:
        T - the element type
        Returns:
        the comparator ordering method
      • comparator

        public Comparator<T> comparator()
        Get the comparator. Returns null if the method does not use an explicit comparator.
        Returns:
        the comparator or null if the method does not use an explicit comparator