|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.qualitycheck.NumberInRange
public final class NumberInRange
Check if a number is in a given range of a particular datatype.
Field Summary | |
---|---|
static BigInteger |
BYTE_MAX
|
static BigInteger |
BYTE_MIN
|
static BigDecimal |
DOUBLE_MAX
|
static BigDecimal |
DOUBLE_MIN
|
static BigDecimal |
FLOAT_MAX
|
static BigDecimal |
FLOAT_MIN
|
static BigInteger |
INTEGER_MAX
|
static BigInteger |
INTEGER_MIN
|
static BigInteger |
LONG_MAX
|
static BigInteger |
LONG_MIN
|
static BigInteger |
SHORT_MAX
|
static BigInteger |
SHORT_MIN
|
Method Summary | |
---|---|
static byte |
checkByte(Number number)
Checks if a given number is in the range of a byte. |
static double |
checkDouble(Number number)
Checks if a given number is in the range of a double. |
static float |
checkFloat(Number number)
Checks if a given number is in the range of a float. |
static int |
checkInteger(Number number)
Checks if a given number is in the range of an integer. |
static int |
checkLong(Number number)
Checks if a given number is in the range of a long. |
static short |
checkShort(Number number)
Checks if a given number is in the range of a short. |
static boolean |
isInByteRange(Number number)
Test if a number is in the range of the datatype byte |
static boolean |
isInDoubleRange(Number number)
Test if a number is in the range of the datatype double |
static boolean |
isInFloatRange(Number number)
Test if a number is in the range of the datatype float |
static boolean |
isInIntegerRange(Number number)
Test if a number is in the range of the datatype int |
static boolean |
isInLongRange(Number number)
Test if a number is in the range of the datatype long |
static boolean |
isInRange(Number number,
BigDecimal min,
BigDecimal max)
Test if a number is in an arbitrary range. |
static boolean |
isInRange(Number number,
BigInteger min,
BigInteger max)
Test if a number is in an arbitrary range. |
static boolean |
isInShortRange(Number number)
Test if a number is in the range of the datatype short |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final BigInteger BYTE_MIN
public static final BigInteger BYTE_MAX
public static final BigInteger SHORT_MIN
public static final BigInteger SHORT_MAX
public static final BigInteger INTEGER_MIN
public static final BigInteger INTEGER_MAX
public static final BigInteger LONG_MIN
public static final BigInteger LONG_MAX
public static final BigDecimal FLOAT_MAX
public static final BigDecimal FLOAT_MIN
public static final BigDecimal DOUBLE_MAX
public static final BigDecimal DOUBLE_MIN
Method Detail |
---|
public static byte checkByte(@Nonnull Number number)
number
- a number which should be in the range of a byte (positive or negative)
Byte.MIN_VALUE
,
Byte.MAX_VALUE
public static short checkShort(@Nonnull Number number)
number
- a number which should be in the range of a short (positive or negative)
Short.MIN_VALUE
,
Short.MAX_VALUE
public static int checkInteger(@Nonnull Number number)
number
- a number which should be in the range of an integer (positive or negative)
Integer.MIN_VALUE
,
Integer.MAX_VALUE
public static int checkLong(@Nonnull Number number)
number
- a number which should be in the range of a long (positive or negative)
Long.MIN_VALUE
,
Long.MAX_VALUE
public static float checkFloat(@Nonnull Number number)
number
- a number which should be in the range of a float (positive or negative)
Float.MIN_VALUE
,
Float.MAX_VALUE
public static double checkDouble(@Nonnull Number number)
number
- a number which should be in the range of a double (positive or negative)
Double.MIN_VALUE
,
Double.MAX_VALUE
public static boolean isInByteRange(@Nonnull Number number)
byte
number
- a number
byte
public static boolean isInShortRange(@Nonnull Number number)
short
number
- a number
short
public static boolean isInIntegerRange(@Nonnull Number number)
int
number
- a number
int
public static boolean isInLongRange(@Nonnull Number number)
long
number
- a number
long
public static boolean isInRange(@Nonnull Number number, @Nonnull BigInteger min, @Nonnull BigInteger max)
number
- a numbermin
- lower boundary of the rangemax
- upper boundary of the range
public static boolean isInRange(@Nonnull Number number, @Nonnull BigDecimal min, @Nonnull BigDecimal max)
number
- a numbermin
- lower boundary of the rangemax
- upper boundary of the range
public static boolean isInFloatRange(@Nonnull Number number)
float
number
- a number
float
public static boolean isInDoubleRange(@Nonnull Number number)
double
number
- a number
double
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |