Class XYSequencePointComparator<X extends Number & Comparable,​Y extends Number & Comparable>

    • Constructor Detail

      • XYSequencePointComparator

        public XYSequencePointComparator()
        The default constructor uses comparison by X in ascending manner.
      • XYSequencePointComparator

        public XYSequencePointComparator​(XYSequencePointComparator.Comparison comp,
                                         boolean ascending)
        This constructor initializes the comparator either with comparison by X or by Y or both. Either in ascending manner or descending.
        Parameters:
        comp - the type of comparison
        ascending - if true then the ordering is done in ascending manner, otherwise descending
    • Method Detail

      • compare

        public int compare​(DataPoint o1,
                           DataPoint 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 class DataPointComparator
        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.