-
public class Region
A one dimensional region represented by a starting and ending value.
-
-
Field Summary
Fields Modifier and Type Field Description private FastNumber
min
private FastNumber
max
-
Method Summary
Modifier and Type Method Description void
setMin(Number min)
void
setMax(Number max)
static Region
withDefaults(Region defaults)
void
setMinMax(Region region)
static Number
measure(Number v1, Number v2)
Number
length()
boolean
contains(Number value)
Tests whether a value is within the given range boolean
intersects(Region region)
Number
center()
Number
transform(double value, Region region2)
Transform a value relative to this region into it's corresponding value relative to thespecified region. Number
transform(double value, Region region2, boolean flip)
double
transform(double value, double min, double max, boolean flip)
Number
ratio(Region r2)
double
ratio(double min, double max)
void
union(Number value)
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. void
intersect(Region input)
The result of an intersect will always be an equal or smaller size region. boolean
intersects(Number line2Min, Number line2Max)
Tests whether this segment intersects another boolean
isMinSet()
boolean
isMaxSet()
boolean
isDefined()
String
toString()
-
-
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()
-
-
-
-