public class Region extends Object
Modifier and Type | Method and Description |
---|---|
Number |
center() |
boolean |
contains(Number value)
Tests whether a value is within the given range
|
Number |
getMax() |
Number |
getMin() |
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 |
intersects(Region region) |
boolean |
isDefined() |
boolean |
isMaxSet() |
boolean |
isMinSet() |
Number |
length() |
static Number |
measure(Number v1,
Number v2) |
double |
ratio(double min,
double max) |
Number |
ratio(Region r2) |
void |
setMax(Number max) |
void |
setMin(Number min) |
void |
setMinMax(Region region) |
String |
toString() |
double |
transform(double value,
double min,
double max,
boolean flip) |
Number |
transform(double value,
Region region2)
Transform a value relative to this region into it's corresponding value relative to the
specified region.
|
Number |
transform(double value,
Region region2,
boolean flip) |
void |
union(Number value) |
void |
union(Region input)
Compares the input bounds min/max against this instance's current min/max.
|
static Region |
withDefaults(Region defaults) |
public void setMinMax(Region region)
public static Number measure(Number v1, Number v2)
v1
- v2
- public Number length()
public boolean contains(Number value)
value
- public boolean intersects(Region region)
public Number center()
public Number transform(double value, Region region2)
value
- region2
- public double transform(double value, double min, double max, boolean flip)
public double ratio(double min, double max)
min
- max
- public void union(Number value)
public void union(Region input)
input
- public void intersect(Region input)
input
- public boolean intersects(Number line2Min, Number line2Max)
line2Min
- line2Max
- public boolean isMinSet()
public Number getMin()
public void setMin(Number min)
public boolean isMaxSet()
public Number getMax()
public void setMax(Number max)
public boolean isDefined()