Package org.sikuli.script.compare
Class HorizontalComparator
- java.lang.Object
-
- org.sikuli.script.compare.HorizontalComparator
-
- All Implemented Interfaces:
Comparator<Region>
public class HorizontalComparator extends Object implements Comparator<Region>
Compares the Regions by x-position.
-
-
Constructor Summary
Constructors Constructor Description HorizontalComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Region region1, Region region2)Compares the X-Position of twoRegionobjects.-
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(Region region1, Region region2)
Compares the X-Position of twoRegionobjects.- Specified by:
comparein interfaceComparator<Region>- Parameters:
region1- The firstRegionobjectregion2- The secondRegionobject- Returns:
- -1 if the x-position of region1 is smaller
- 0 if the x-positions are equal
- 1 if the x-position of region2 is smaller
-
-