Package com.arms.api.util
Class RangeUtil
- java.lang.Object
-
- com.arms.api.util.RangeUtil
-
public class RangeUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RangeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.LongclampMax(java.lang.Long input, java.lang.Long max)Ensures the input value is not greater than the maximum value.static java.lang.LongclampMin(java.lang.Long input, java.lang.Long min)Ensures the input value is not less than the minimum value.static java.lang.LongreturnIfGreater(java.lang.Long input, java.lang.Long max)Ensures the input value is not greater than the maximum value.static java.lang.LongreturnIfLess(java.lang.Long input, java.lang.Long min)Ensures the input value is not less than the minimum value.
-
-
-
Method Detail
-
clampMin
public static java.lang.Long clampMin(java.lang.Long input, java.lang.Long min)Ensures the input value is not less than the minimum value.- Parameters:
input- the value to comparemin- the minimum value- Returns:
- the greater of input and min
-
clampMax
public static java.lang.Long clampMax(java.lang.Long input, java.lang.Long max)Ensures the input value is not greater than the maximum value.- Parameters:
input- the value to comparemax- the maximum value- Returns:
- the lesser of input and max
-
returnIfLess
public static java.lang.Long returnIfLess(java.lang.Long input, java.lang.Long min)Ensures the input value is not less than the minimum value. If the input value is less than the specified minimum, the input value is returned. Otherwise, the minimum value is returned.- Parameters:
input- the value to comparemin- the minimum value- Returns:
- the greater of input and min
-
returnIfGreater
public static java.lang.Long returnIfGreater(java.lang.Long input, java.lang.Long max)Ensures the input value is not greater than the maximum value. If the input value is greater than the specified maximum, the input value is returned. Otherwise, the maximum value is returned.- Parameters:
input- the value to comparemax- the maximum value- Returns:
- the lesser of input and max
-
-