- java.lang.Object
-
- bdv.util.BoundedRange
-
public final class BoundedRange extends Object
A bounded range withminBound <= min <= max <= maxBound.BoundedRangeis immutable.withMin(double),withMinBound(double)etc derive a newBoundedRangewith the givenmin,minBoundetc, while maintaining theminBound <= min <= max <= maxBoundproperty. For example,this.withMin(x), will also updatemax, ifx > this.getMax().join(other)will derive a newBoundedRange, withminthe minimum ofthis.getMin()andother.getMin()and so on.- Author:
- Tobias Pietzsch
-
-
Constructor Summary
Constructors Constructor Description BoundedRange(double minBound, double maxBound, double min, double max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)BoundsgetBounds()doublegetMax()doublegetMaxBound()doublegetMin()doublegetMinBound()inthashCode()BoundedRangejoin(BoundedRange other)StringtoString()BoundedRangewithMax(double newMax)BoundedRangewithMaxBound(double newMaxBound)BoundedRangewithMin(double newMin)BoundedRangewithMinBound(double newMinBound)
-
-
-
Method Detail
-
getMinBound
public double getMinBound()
-
getMaxBound
public double getMaxBound()
-
getBounds
public Bounds getBounds()
-
getMin
public double getMin()
-
getMax
public double getMax()
-
withMax
public BoundedRange withMax(double newMax)
-
withMin
public BoundedRange withMin(double newMin)
-
withMaxBound
public BoundedRange withMaxBound(double newMaxBound)
-
withMinBound
public BoundedRange withMinBound(double newMinBound)
-
join
public BoundedRange join(BoundedRange other)
-
-