Package adams.data.threeway
Class L2PointComparator
- java.lang.Object
-
- adams.data.container.DataPointComparator<L2Point>
-
- adams.data.threeway.L2PointComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<L2Point>
public class L2PointComparator extends adams.data.container.DataPointComparator<L2Point>
A comparator for level 2 points.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_UseData
whether to compare data as well as z.
-
Constructor Summary
Constructors Constructor Description L2PointComparator()
The default constructor uses comparison by x in ascending manner.L2PointComparator(boolean useData, boolean ascending)
This constructor initializes the comparator either with comparison by x or by y as well.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(L2Point o1, L2Point o2)
Compares its two arguments for order.boolean
isUsingData()
Returns whether the data is used for ordering as well.-
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
-
L2PointComparator
public L2PointComparator()
The default constructor uses comparison by x in ascending manner.
-
L2PointComparator
public L2PointComparator(boolean useData, boolean ascending)
This constructor initializes the comparator either with comparison by x or by y as well. Either in ascending manner or descending.- Parameters:
useData
- if true then y is used for comparison as well as xascending
- if true then the ordering is done in ascending manner, otherwise descending
-
-
Method Detail
-
isUsingData
public boolean isUsingData()
Returns whether the data is used for ordering as well.- Returns:
- true if data is used for ordering as well
-
compare
public int compare(L2Point o1, L2Point 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<L2Point>
- Specified by:
compare
in classadams.data.container.DataPointComparator<L2Point>
- 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.
-
-