|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.syntax.Numbers
public class Numbers
Helper class for processing Groovy numeric literals.
Field Summary | |
---|---|
private static java.math.BigDecimal |
MAX_DOUBLE
|
private static java.math.BigDecimal |
MAX_FLOAT
|
private static java.math.BigInteger |
MAX_INTEGER
|
private static java.math.BigInteger |
MAX_LONG
|
private static java.math.BigDecimal |
MIN_DOUBLE
|
private static java.math.BigDecimal |
MIN_FLOAT
|
private static java.math.BigInteger |
MIN_INTEGER
|
private static java.math.BigInteger |
MIN_LONG
|
Constructor Summary | |
---|---|
Numbers()
|
Method Summary | |
---|---|
static boolean |
isDigit(char c)
Returns true if the specified character is a base-10 digit. |
static boolean |
isHexDigit(char c)
Returns true if the specified character is a base-16 digit. |
static boolean |
isNumericTypeSpecifier(char c,
boolean isDecimal)
Returns true if the specified character is a valid type specifier for a numeric value. |
static boolean |
isOctalDigit(char c)
Returns true if the specific character is a base-8 digit. |
static java.lang.Number |
parseDecimal(java.lang.String text)
Builds a Number from the given decimal descriptor. |
static java.lang.Number |
parseInteger(java.lang.String text)
Builds a Number from the given integer descriptor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.math.BigInteger MAX_LONG
private static final java.math.BigInteger MIN_LONG
private static final java.math.BigInteger MAX_INTEGER
private static final java.math.BigInteger MIN_INTEGER
private static final java.math.BigDecimal MAX_DOUBLE
private static final java.math.BigDecimal MIN_DOUBLE
private static final java.math.BigDecimal MAX_FLOAT
private static final java.math.BigDecimal MIN_FLOAT
Constructor Detail |
---|
public Numbers()
Method Detail |
---|
public static boolean isDigit(char c)
public static boolean isOctalDigit(char c)
public static boolean isHexDigit(char c)
public static boolean isNumericTypeSpecifier(char c, boolean isDecimal)
public static java.lang.Number parseInteger(java.lang.String text)
text
- literal text to parse
java.lang.NumberFormatException
- if the number does not fit within the type
requested by the type specifier suffix (invalid numbers don't make
it here)public static java.lang.Number parseDecimal(java.lang.String text)
text
- literal text to parse
java.lang.NumberFormatException
- if the number does not fit within the type
requested by the type specifier suffix (invalid numbers don't make
it here)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |