Package adams.data.threeway
Class L1PointComparator
- java.lang.Object
-
- adams.data.container.DataPointComparator<L1Point>
-
- adams.data.threeway.L1PointComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<L1Point>
public class L1PointComparator extends adams.data.container.DataPointComparator<L1Point>
A comparator for level one 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_UseY
whether to compare Y as well.
-
Constructor Summary
Constructors Constructor Description L1PointComparator()
The default constructor uses comparison by X in ascending manner.L1PointComparator(boolean useY, boolean ascending)
This constructor initializes the comparator either with comparison by X or Y as well.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(L1Point o1, L1Point o2)
Compares its two arguments for order.boolean
isUsingY()
Returns whether the Y 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
-
L1PointComparator
public L1PointComparator()
The default constructor uses comparison by X in ascending manner.
-
L1PointComparator
public L1PointComparator(boolean useY, boolean ascending)
This constructor initializes the comparator either with comparison by X or Y as well. Either in ascending manner or descending.- Parameters:
useY
- 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
-
isUsingY
public boolean isUsingY()
Returns whether the Y used for ordering as well.- Returns:
- true if Y is used as well
-
compare
public int compare(L1Point o1, L1Point 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<L1Point>
- Specified by:
compare
in classadams.data.container.DataPointComparator<L1Point>
- 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.
-
-