public class NumberUtil
extends java.lang.Object
Constructor and Description |
---|
NumberUtil() |
Modifier and Type | Method and Description |
---|---|
static double |
constrain(double value,
double lowerBound,
double upperBound)
Constrains the value to specified bounds
|
static float |
constrain(float value,
float lowerBound,
float upperBound)
Constrains the value to specified bounds
|
static int |
constrain(int value,
int lowerBound,
int upperBound)
Constrains the value to specified bounds
|
static long |
constrain(long value,
long lowerBound,
long upperBound)
Constrains the value to specified bounds
|
static boolean |
isIntegerType(java.lang.Class<?> type)
Checks whether the specified type is an integer type
|
public static int constrain(int value, int lowerBound, int upperBound)
value
- The value to constrainlowerBound
- The lover boundupperBound
- The upper boundspublic static long constrain(long value, long lowerBound, long upperBound)
value
- The value to constrainlowerBound
- The lover boundupperBound
- The upper boundspublic static float constrain(float value, float lowerBound, float upperBound)
value
- The value to constrainlowerBound
- The lover boundupperBound
- The upper boundspublic static double constrain(double value, double lowerBound, double upperBound)
value
- The value to constrainlowerBound
- The lover boundupperBound
- The upper boundspublic static boolean isIntegerType(java.lang.Class<?> type)
type
- Type to check