Top Description Constructors Methods
impl.org.controlsfx.tools

public Class MathTools

extends Object
Class Inheritance
Imports
java.util.Objects

Contains methods Math might also contain but doesn't.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static double

Returns:

value if lowerBound <= value <= upperBound
lowerBound if value < lowerBound
upperBound if upperBound < value
inInterval
(double
the interval's lower bound; included in the interval
lowerBound
,
double
the value which will be checked
value
,
double
the interval's upper bound; included in the interval
upperBound
)

Checks whether the specified value lies in the closed interval defined by the specified bounds.

public static boolean

Returns:

true if lowerBound <= value <= upperBound
false otherwise
isInInterval
(double
the interval's lower bound; included in the interval
lowerBound
,
double
the value which will be checked
value
,
double
the interval's upper bound; included in the interval
upperBound
)

Checks whether the specified value lies in the closed interval defined by the specified bounds.

public static double

Returns:

a value from the array which is smaller then or equal to any other value from the array
min
(double...
a non-null, non-empty array of double values
values
)

Returns the smallest value in the specified array according to Math#min(double, double).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MathToolsback to summary
public MathTools()

Method Detail

inIntervalback to summary
public static double inInterval(double lowerBound, double value, double upperBound)

Checks whether the specified value lies in the closed interval defined by the specified bounds. If it does, it is returned; otherwise the bound closer to the value will be returned.

Parameters
lowerBound:double

the interval's lower bound; included in the interval

value:double

the value which will be checked

upperBound:double

the interval's upper bound; included in the interval

Returns:double

value if lowerBound <= value <= upperBound
lowerBound if value < lowerBound
upperBound if upperBound < value

isInIntervalback to summary
public static boolean isInInterval(double lowerBound, double value, double upperBound)

Checks whether the specified value lies in the closed interval defined by the specified bounds.

Parameters
lowerBound:double

the interval's lower bound; included in the interval

value:double

the value which will be checked

upperBound:double

the interval's upper bound; included in the interval

Returns:boolean

true if lowerBound <= value <= upperBound
false otherwise

minback to summary
public static double min(double... values)

Returns the smallest value in the specified array according to Math#min(double, double).

Parameters
values:double[]

a non-null, non-empty array of double values

Returns:double

a value from the array which is smaller then or equal to any other value from the array

Exceptions
NullPointerException:
if the values array is null
IllegalArgumentException:
if the values array is empty (i.e. has length 0)