Package science.aist.imaging.api.compare
Class JavaPointOriginComparator
- java.lang.Object
-
- science.aist.imaging.api.compare.JavaPointOriginComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<JavaPoint2D>
public class JavaPointOriginComparator extends Object implements Comparator<JavaPoint2D>, Serializable
Compares two
JavaPoint2D
s based on their distance to the given origin- Since:
- 1.0
- Author:
- Christoph Praschl
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JavaPointOriginComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(JavaPoint2D o1, JavaPoint2D o2)
-
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
-
-
-
-
Method Detail
-
compare
public int compare(JavaPoint2D o1, JavaPoint2D o2)
- Specified by:
compare
in interfaceComparator<JavaPoint2D>
- Parameters:
o1
- point 1o2
- point 2- Returns:
- a value < 0 if o1 is closer to origin than o2 == 0 if o1 and o2 have the same distance to origin > 0 if o1 is further away from origin than o2
-
-