public class NumberUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTE |
static Byte |
BYTE_ZERO |
static int |
DECIMAL |
static BigDecimal |
DECIMAL_ZERO |
static int |
DOUBLE |
static Double |
DOUBLE_ZERO |
static int |
FLOAT |
static Float |
FLOAT_ZERO |
static int |
INT |
static Integer |
INT_ZERO |
static int |
INTEGER |
static BigInteger |
INTEGER_ZERO |
static int |
LONG |
static Long |
LONG_ZERO |
static int |
SHORT |
static Short |
SHORT_ZERO |
| Constructor and Description |
|---|
NumberUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Number |
add(Number n1,
int n2) |
static int |
compare(Number n1,
Number n2) |
static int |
getFractionDigits(Number n) |
static int |
getTotalDigits(Number n) |
static int |
getType(Number number) |
static String |
getTypeName(Number number) |
static void |
main(String[] args) |
static Number |
parse(String str,
int type) |
static Number |
parseByte(String str) |
static Number |
parseDecimal(String str) |
static Double |
parseDouble(String str) |
static Float |
parseFloat(String str) |
static Number |
parseInt(String str) |
static Number |
parseInteger(String str) |
static Number |
parseLong(String str) |
static Number |
parseShort(String str) |
static int |
sign(Number n) |
static void |
test(String val,
int type,
Number test) |
static void |
test(String val1,
int type1,
String val2,
int type2,
int result) |
public static final int BYTE
public static final int SHORT
public static final int INT
public static final int LONG
public static final int INTEGER
public static final int DECIMAL
public static final int FLOAT
public static final int DOUBLE
public static final Byte BYTE_ZERO
public static final Short SHORT_ZERO
public static final Integer INT_ZERO
public static final Long LONG_ZERO
public static final BigInteger INTEGER_ZERO
public static final BigDecimal DECIMAL_ZERO
public static final Float FLOAT_ZERO
public static final Double DOUBLE_ZERO
public static Number parseByte(String str) throws NumberFormatException
NumberFormatExceptionpublic static Number parseShort(String str) throws NumberFormatException
NumberFormatExceptionpublic static Number parseInt(String str) throws NumberFormatException
NumberFormatExceptionpublic static Number parseLong(String str) throws NumberFormatException
NumberFormatExceptionpublic static Number parseInteger(String str) throws NumberFormatException
NumberFormatExceptionpublic static Number parseDecimal(String str) throws NumberFormatException
NumberFormatExceptionpublic static Float parseFloat(String str) throws NumberFormatException
NumberFormatExceptionpublic static Double parseDouble(String str) throws NumberFormatException
NumberFormatExceptionpublic static Number parse(String str, int type) throws NumberFormatException
NumberFormatExceptionpublic static int getType(Number number)
public static int sign(Number n)
public static int getTotalDigits(Number n)
public static int getFractionDigits(Number n)
public static void main(String[] args)
Copyright © 2019. All rights reserved.