|
MVT API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--math.util.Parser
The class Parser is used to parse mathematical expression Strings into Expr class objects.
Field Summary | |
(package private) static int |
ABS
|
(package private) static int |
ACOS
|
(package private) static int |
ACOT
|
(package private) static int |
ACSC
|
(package private) static int |
ASEC
|
(package private) static int |
ASIN
|
(package private) static int |
ATAN
|
(package private) static int |
COS
|
(package private) static int |
COSH
|
(package private) static int |
COT
|
(package private) static int |
COTH
|
(package private) static int |
CSC
|
(package private) static int |
CSCH
|
(package private) static int |
EXP
|
(package private) static java.lang.String[] |
functionStrings
|
(package private) static int |
LN
|
(package private) static int |
SEC
|
(package private) static int |
SECH
|
(package private) static int |
SIN
|
(package private) static int |
SINH
|
(package private) static int |
SQRT
|
(package private) static int |
TAN
|
(package private) static int |
TANH
|
Method Summary | |
static Function |
parseFunction(java.lang.String str)
This static function will parse a string representing an arithematic expression |
static double |
parseNumber(java.lang.String str)
Method parseNumber takes a string and
parses it into a number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final int ABS
static final int ACSC
static final int ACOT
static final int ACOS
static final int ASEC
static final int ASIN
static final int ATAN
static final int CSC
static final int COT
static final int COS
static final int EXP
static final int CSCH
static final int COTH
static final int COSH
static final int SECH
static final int SINH
static final int TANH
static final int LN
static final int SEC
static final int SIN
static final int SQRT
static final int TAN
static final java.lang.String[] functionStrings
Method Detail |
public static Function parseFunction(java.lang.String str) throws SyntaxException
str
- a String
object which represents
a function.
for example "sin(x)" is a function object containing an operator
"sin" and an operand (argument) "x".
SyntaxException
- for invalid and unparsable String
expressionspublic static double parseNumber(java.lang.String str) throws SyntaxException
parseNumber
takes a string and
parses it into a number. Similar to parseDouble and parseInt
of the Double and Integer classes, except this allows mathematical
constants such as pi and e, and throws a SyntaxException similar to
the method parse.
str
- a String
representing a number (double, float
or integer)
double
value of the input string.
SyntaxException
- if the string cannot be parsed to a
number.
|
MVT API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |