Package mpicbg.stitching.fusion
Class Interval
java.lang.Object
mpicbg.stitching.fusion.Interval
- Author:
- Mark Hiner hinerm at gmail.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcontains(int point) booleanequalsInterval(Interval other) Check to see if another interval is the same as this interval.booleanintersects(Interval other) Determines if this interval has an intersection with another interval.intmax()intmin()booleansetMax(int max) Update the end position of this interval.booleansetMin(int min) Update the start position of this interval.toString()
-
Constructor Details
-
Interval
public Interval(int... points) Constructs a new Interval using the smallest and largest values in the provided points. -
Interval
Copying constructor
-
-
Method Details
-
setMin
public boolean setMin(int min) Update the start position of this interval. If after this setting,min > max, setsmax = min.- Returns:
- true if the max was also modified during this call
-
setMax
public boolean setMax(int max) Update the end position of this interval. If after this setting,max < min, setsmin = max.- Returns:
- true if the min was also modified during this call
-
min
public int min()- Returns:
- Start position for this interval
-
max
public int max()- Returns:
- End position for this interval
-
contains
public int contains(int point) - Returns:
- -1 if this interval is completely to the left of the point. 1 if this interval is completely to the right of the point. 0 if the interval intersects (contains) the point.
-
intersects
Determines if this interval has an intersection with another interval. -
equalsInterval
Check to see if another interval is the same as this interval. -
toString
-