Class AbstractSortOrderComparator<T>

    • Constructor Detail

      • AbstractSortOrderComparator

        public AbstractSortOrderComparator​(SortOrder sortOrder)
        Sort order constructor.
        Parameters:
        sortOrder - The order in which to perform comparisons.
        Throws:
        java.lang.NullPointerException - if the given sort order is null.
    • Method Detail

      • compareImpl

        protected abstract int compareImpl​(T object1,
                                           T object2)
        Implementation to compare two objects for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. Implementations do not need to perform special checks for identity, as the compare(Object, Object) implementation will do this.
        Parameters:
        object1 - The first object to be compared.
        object2 - The second object to be compared.
        Returns:
        A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
        Throws:
        java.lang.ClassCastException - if the arguments' types prevent them from being compared by this comparator.