java.lang.Object
io.jenetics.util.DoubleRange
- All Implemented Interfaces:
Serializable
Double range class.
- Since:
- 3.2
- Version:
- 6.0
- See Also:
- Implementation Note:
- This class is immutable and thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double value) Checks whether the givenvalue
is within the range[min, max)
.boolean
int
hashCode()
intersect
(DoubleRange other) Return the intersection ofthis
range with theother
.double
max()
Return the maximum value of the double range.double
min()
Return the minimum value of the double range.static DoubleRange
of
(double min, double max) Create a newDoubleRange
object with the givenmin
andmax
values.toString()
-
Method Details
-
min
Return the minimum value of the double range.- Returns:
- the minimum value of the double range
-
max
Return the maximum value of the double range.- Returns:
- the maximum value of the double range
-
contains
Checks whether the givenvalue
is within the range[min, max)
.- Parameters:
value
- the value to check- Returns:
true
if thevalue
is with the range[min, max)
,false
otherwise- Since:
- 8.0
-
intersect
Return the intersection ofthis
range with theother
.- Parameters:
other
- the intersection range orOptional.empty()
if there is none- Returns:
- the range intersection
- Since:
- 8.0
-
of
Create a newDoubleRange
object with the givenmin
andmax
values.- Parameters:
min
- the lower bound of the double rangemax
- the upper bound of the double range- Returns:
- a new
DoubleRange
object - Throws:
IllegalArgumentException
- ifmin > max
-
hashCode
-
equals
-
toString
-