Package adams.data.timeseries
Class TimeseriesPointComparator<P extends TimeseriesPoint>
- java.lang.Object
-
- adams.data.container.DataPointComparator<P>
-
- adams.data.timeseries.TimeseriesPointComparator<P>
-
- All Implemented Interfaces:
Serializable
,Comparator<P>
public class TimeseriesPointComparator<P extends TimeseriesPoint> extends DataPointComparator<P>
A comparator for timeseries points.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.data.container.DataPointComparator
m_Ascending
-
-
Constructor Summary
Constructors Constructor Description TimeseriesPointComparator()
The default constructor uses comparison by timestamp in ascending manner.TimeseriesPointComparator(boolean ascending)
This constructor initializes the comparator either in ascending manner or descending.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(TimeseriesPoint o1, TimeseriesPoint o2)
Compares its two arguments for order.-
Methods inherited from class adams.data.container.DataPointComparator
isAscending
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
TimeseriesPointComparator
public TimeseriesPointComparator()
The default constructor uses comparison by timestamp in ascending manner.
-
TimeseriesPointComparator
public TimeseriesPointComparator(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
-
compare
public int compare(TimeseriesPoint o1, TimeseriesPoint 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 interfaceComparator<P extends TimeseriesPoint>
- Specified by:
compare
in classDataPointComparator<P extends TimeseriesPoint>
- Parameters:
o1
- the first objecto2
- 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.
-
-