- java.lang.Object
-
- impl.org.controlsfx.tools.MathTools
-
-
Constructor Summary
Constructors Constructor Description MathTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
inInterval(double lowerBound, double value, double upperBound)
Checks whether the specified value lies in the closed interval defined by the specified bounds.static boolean
isInInterval(double lowerBound, double value, double upperBound)
Checks whether the specified value lies in the closed interval defined by the specified bounds.static double
min(double... values)
Returns the smallest value in the specified array according toMath.min(double, double)
.
-
-
-
Method Detail
-
isInInterval
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
- the interval's lower bound; included in the intervalvalue
- the value which will be checkedupperBound
- the interval's upper bound; included in the interval- Returns:
true
iflowerBound
<=value
<=upperBound
false
otherwise
-
inInterval
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
- the interval's lower bound; included in the intervalvalue
- the value which will be checkedupperBound
- the interval's upper bound; included in the interval- Returns:
value
iflowerBound
<=value
<=upperBound
lowerBound
ifvalue
<lowerBound
upperBound
ifupperBound
<value
-
min
public static double min(double... values)
Returns the smallest value in the specified array according toMath.min(double, double)
.- Parameters:
values
- a non-null, non-empty array of double values- Returns:
- a value from the array which is smaller then or equal to any other value from the array
- Throws:
NullPointerException
- if the values array isnull
IllegalArgumentException
- if the values array is empty (i.e. haslength
0)
-
-