Record Class DoubleRange
java.lang.Object
java.lang.Record
io.jenetics.util.DoubleRange
- Record Components:
min- the minimum value of the rangemax- the maximum value of the range
- All Implemented Interfaces:
Serializable
Double range class.
- Since:
- 3.2
- Version:
- 8.3
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDoubleRange(double min, double max) Create a newDoubleRangeobject with the givenminandmaxvalues. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double value) Checks whether the givenvalueis within the range[min, max).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intersect(DoubleRange other) Return the intersection ofthisrange with theother.doublemax()Returns the value of themaxrecord component.doublemin()Returns the value of theminrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
DoubleRange
Create a newDoubleRangeobject with the givenminandmaxvalues.- Parameters:
min- the lower bound of the double rangemax- the upper bound of the double range- Throws:
IllegalArgumentException- ifmin > maxor one of the parameters is not finite
-
-
Method Details
-
contains
Checks whether the givenvalueis within the range[min, max).- Parameters:
value- the value to check- Returns:
trueif thevalueis with the range[min, max),falseotherwise- Since:
- 8.0
-
intersect
Return the intersection ofthisrange with theother.- Parameters:
other- the intersection range orOptional.empty()if there is none- Returns:
- the range intersection
- Since:
- 8.0
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
min
-
max
-