- 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 doubleinInterval(double lowerBound, double value, double upperBound)Checks whether the specified value lies in the closed interval defined by the specified bounds.static booleanisInInterval(double lowerBound, double value, double upperBound)Checks whether the specified value lies in the closed interval defined by the specified bounds.static doublemin(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:
trueiflowerBound<=value<=upperBound
falseotherwise
-
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:
valueiflowerBound<=value<=upperBound
lowerBoundifvalue<lowerBound
upperBoundifupperBound<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 isnullIllegalArgumentException- if the values array is empty (i.e. haslength0)
-
-