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

    • Field Detail

      • m_MetaDataKey

        protected String m_MetaDataKey
        the meta-data value to take into account for the sorting.
    • Constructor Detail

      • SequencePlotPointComparator

        public SequencePlotPointComparator()
        The default constructor uses comparison by XandY in ascending manner and not meta-data key.
      • SequencePlotPointComparator

        public SequencePlotPointComparator​(XYSequencePointComparator.Comparison comp,
                                           boolean ascending,
                                           String metaDataKey)
        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

      • getMetaDataKey

        public String getMetaDataKey()
        Returns the meta-data key to use for the comparison.
        Returns:
        the key, null if not used
      • getMetaData

        protected Object getMetaData​(SequencePlotPoint p)
        Returns the associated meta-data value.
        Parameters:
        p - the point to obtain the meta-data from
        Returns:
        the value, null if not available
      • 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.
        Overrides:
        compare in class XYSequencePointComparator<X extends Number & Comparable,​Y extends Number & Comparable>
        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.