-
public class RegionA one dimensional region represented by a starting and ending value.
-
-
Field Summary
Fields Modifier and Type Field Description private FastNumberminprivate FastNumbermax
-
Method Summary
Modifier and Type Method Description voidsetMin(Number min)voidsetMax(Number max)static RegionwithDefaults(Region defaults)voidsetMinMax(Region region)static Numbermeasure(Number v1, Number v2)Numberlength()booleancontains(Number value)Tests whether a value is within the given range booleanintersects(Region region)Numbercenter()Numbertransform(double value, Region region2)Transform a value relative to this region into it's corresponding value relative to thespecified region. Numbertransform(double value, Region region2, boolean flip)doubletransform(double value, double min, double max, boolean flip)Numberratio(Region r2)doubleratio(double min, double max)voidunion(Number value)voidunion(Region input)Compares the input bounds min/max against this instance's current min/max.If the input.min is less than this.min then this.min will be set to input.min.If the input.max is greater than this.max then this.max will be set to input.maxThe result of a union will always be an equal or larger size region. voidintersect(Region input)The result of an intersect will always be an equal or smaller size region. booleanintersects(Number line2Min, Number line2Max)Tests whether this segment intersects another booleanisMinSet()booleanisMaxSet()booleanisDefined()StringtoString()-
-
Method Detail
-
withDefaults
static Region withDefaults(Region defaults)
-
intersects
boolean intersects(Region region)
-
transform
Number transform(double value, Region region2)
Transform a value relative to this region into it's corresponding value relative to thespecified region.
-
transform
double transform(double value, double min, double max, boolean flip)
-
ratio
double ratio(double min, double max)
-
union
void union(Region input)
Compares the input bounds min/max against this instance's current min/max.If the input.min is less than this.min then this.min will be set to input.min.If the input.max is greater than this.max then this.max will be set to input.maxThe result of a union will always be an equal or larger size region.
-
intersect
void intersect(Region input)
The result of an intersect will always be an equal or smaller size region.
-
intersects
boolean intersects(Number line2Min, Number line2Max)
Tests whether this segment intersects another
-
isMinSet
boolean isMinSet()
-
isMaxSet
boolean isMaxSet()
-
isDefined
boolean isDefined()
-
-
-
-