rangesearch.ref
Class AboveBelowComparator
java.lang.Object
jdsl.core.ref.AbstractComparator
rangesearch.ref.AboveBelowComparator
- All Implemented Interfaces:
- jdsl.core.api.Comparator, jdsl.core.api.EqualityComparator
- public class AboveBelowComparator
- extends jdsl.core.ref.AbstractComparator
- implements jdsl.core.api.Comparator
A comparator to compare points by y coordinate. Horizontally aligned points
are considered equal.
Field Summary |
protected jdsl.geomobj.api.GeomTester2D |
m_tester
|
Method Summary |
int |
compare(java.lang.Object a,
java.lang.Object b)
|
boolean |
isComparable(java.lang.Object a)
Returns whether or not an object is comparable with this comparator. |
Methods inherited from class jdsl.core.ref.AbstractComparator |
isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jdsl.core.api.Comparator |
isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo |
Methods inherited from interface jdsl.core.api.EqualityComparator |
isEqualTo |
m_tester
protected jdsl.geomobj.api.GeomTester2D m_tester
AboveBelowComparator
public AboveBelowComparator(jdsl.geomobj.api.GeomTester2D tester)
- Parameters:
tester
- the geometry tester to use for comparisions.
compare
public int compare(java.lang.Object a,
java.lang.Object b)
throws java.lang.ClassCastException
- Specified by:
compare
in interface jdsl.core.api.Comparator
- Parameters:
a
- the first object to compare.b
- the second object to compare.
- Throws:
jdsl.geomobj.api.InvalidPointException
- if the point comparision fails.
java.lang.ClassCastException
isComparable
public boolean isComparable(java.lang.Object a)
- Returns whether or not an object is comparable with this comparator.
- Specified by:
isComparable
in interface jdsl.core.api.EqualityComparator
- Parameters:
a
- the object to consider.
- Returns:
- true if the object is a point, false otherwise.