|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.parser.ParserUtilities
Provides access to the current default parser and static utility methods for use with parser operations.
As of 2.5.0, requires the default parser to be a
parser derived from class BaseParser
rather than simply to be a parser that implements
Parser. This guarantees that certain
parser functionality is available.
This class contains only static data and methods and may not be instantiated.
BaseParser,
JPTParser| Field Summary | |
private static BaseParser |
parser
Default parser used by JPT classes. |
| Constructor Summary | |
private |
ParserUtilities()
Prevent instantiation. |
| Method Summary | |
static BaseParser |
getDefaultParser()
Returns the default parser used by JPT classes. |
static boolean |
isXBoolean(Object x)
Return true if x is XBoolean. |
static boolean |
isXFloating(Object x)
Return true if x is floating, that is, if x is one of the types: XBigDecimal,
XDouble,
XFloat. |
static boolean |
isXIntegral(Object x)
Return true if x is integral, that is, if x is one of the types: XBigInteger,
XLong,
XInt,
XShort,
XByte. |
static boolean |
isXNumber(Object x)
Return true if x is an XNumber. |
static void |
setDefaultParser(BaseParser p)
Sets the default parser used by JPT classes to the given parser. |
static XBigDecimal |
toXBigDecimal(XNumber value)
Converts the given value to XBigDecimal. |
static XBigInteger |
toXBigInteger(XNumber value)
Converts the given value to XBigInteger. |
static XDouble |
toXDouble(XNumber value)
Converts the given value to XDouble. |
static XLong |
toXLong(XNumber value)
Converts the given value to XLong. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static BaseParser parser
| Constructor Detail |
private ParserUtilities()
| Method Detail |
public static BaseParser getDefaultParser()
public static void setDefaultParser(BaseParser p)
Sets the default parser used by JPT classes to the given parser.
If null, the default parser is
set to a new standard default parser for JPT,
that is, a new JPTParser.
p - the desired default parserpublic static boolean isXNumber(Object x)
XNumber.
public static boolean isXIntegral(Object x)
XBigInteger,
XLong,
XInt,
XShort,
XByte.
public static boolean isXFloating(Object x)
XBigDecimal,
XDouble,
XFloat.
public static boolean isXBoolean(Object x)
public static XLong toXLong(XNumber value)
value - the value to be convertedpublic static XDouble toXDouble(XNumber value)
value - the value to be convertedpublic static XBigInteger toXBigInteger(XNumber value)
value - the value to be convertedpublic static XBigDecimal toXBigDecimal(XNumber value)
value - the value to be converted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||