Class DataPointComparator<T extends DataPoint>

    • Field Detail

      • m_Ascending

        protected boolean m_Ascending
        whether the ordering is ascending or descending.
    • Constructor Detail

      • DataPointComparator

        public DataPointComparator()
        The default constructor uses comparison in ascending manner.
      • DataPointComparator

        public DataPointComparator​(boolean ascending)
        This constructor initializes the comparator either in ascending manner or descending.
        Parameters:
        ascending - if true then the ordering is done in ascending manner, otherwise descending
    • Method Detail

      • isAscending

        public boolean isAscending()
        Returns whether the ordering is done in ascending or descending manner.
        Returns:
        true if ordering it in ascending manner
      • compare

        public abstract int compare​(T o1,
                                    T o2)
        Compares its two arguments 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.
        Specified by:
        compare in interface Comparator<T extends DataPoint>
        Parameters:
        o1 - the first object
        o2 - the second object
        Returns:
        a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.