Class Region
-
- All Implemented Interfaces:
public class RegionA one dimensional region represented by a starting and ending value.
-
-
Method Summary
Modifier and Type Method Description static RegionwithDefaults(@NonNull() Region defaults)voidsetMinMax(@NonNull() Region region)static Numbermeasure(@Nullable() Number v1, @Nullable() Number v2)Numberlength()booleancontains(@NonNull() Number value)Tests whether a value is within the given range booleanintersects(@NonNull() Region region)Numbercenter()Numbertransform(double value, @NonNull() Region region2)Transform a value relative to this region into it's corresponding value relative to the specified region. Numbertransform(double value, @NonNull() Region region2, boolean flip)doubletransform(double value, double min, double max, boolean flip)Numberratio(@NonNull() Region r2)doubleratio(double min, double max)voidunion(@Nullable() Number value)voidunion(@NonNull() Region input)Compares the input bounds min/max against this instance's current min/max. voidintersect(@NonNull() Region input)The result of an intersect will always be an equal or smaller size region. booleanintersects(@Nullable() Number line2Min, @Nullable() Number line2Max)Tests whether this segment intersects another. booleanisMinSet()NumbergetMin()voidsetMin(@Nullable() Number min)booleanisMaxSet()NumbergetMax()voidsetMax(@Nullable() Number max)booleanisDefined()StringtoString()-
-
Method Detail
-
withDefaults
@NonNull() static Region withDefaults(@NonNull() Region defaults)
-
measure
@Nullable() static Number measure(@Nullable() Number v1, @Nullable() Number v2)
- Returns:
The distance between val1 and val2 or null if either parameters are null.
- Since:
0.9.7
-
intersects
boolean intersects(@NonNull() Region region)
-
transform
@NonNull() Number transform(double value, @NonNull() Region region2)
Transform a value relative to this region into it's corresponding value relative to the specified region.
-
transform
double transform(double value, double min, double max, boolean flip)
-
ratio
double ratio(double min, double max)
- Returns:
length of this series divided by the length of the distance between min and max.
-
union
void union(@NonNull() 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.max The result of a union will always be an equal or larger size region.
-
intersect
void intersect(@NonNull() Region input)
The result of an intersect will always be an equal or smaller size region.
-
intersects
boolean intersects(@Nullable() Number line2Min, @Nullable() Number line2Max)
Tests whether this segment intersects another. A null min represents negative infinity and a null max represents positive infinity, both for the params and for this region's own min / max.
-
isMinSet
boolean isMinSet()
-
isMaxSet
boolean isMaxSet()
-
isDefined
boolean isDefined()
- Returns:
True if both min and max values are non-null, false otherwise. Does *not* consider defaults.
-
-
-
-