Class ElementOrderMethod<T>

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

    public class ElementOrderMethod<T>
    extends java.lang.Object
    implements java.io.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​(java.util.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 java.util.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