|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmic.calc.Mic
public class Mic
Provides the evaluator that calculates integer expressions.
Constructor Summary | |
---|---|
Mic()
|
Method Summary | |
---|---|
int |
calculate(java.lang.String expression)
Calculates the expression. |
java.lang.String |
evaluate(java.lang.String expression)
Evaluates the expression. |
void |
printSyntaxTree(java.lang.String expression,
java.io.Writer out)
Prints the syntax tree of the expression to writer out. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Mic()
Method Detail |
---|
public final int calculate(java.lang.String expression) throws java.lang.IllegalStateException, java.lang.NumberFormatException, ParseException
expression
- to be calculated
ParseException
- if the syntax of the expression is invalid
java.lang.NumberFormatException
- if the parsing of numbers yields invalid
results
java.lang.IllegalStateException
- if the syntax tree is invalid, java.io.IOException
public final java.lang.String evaluate(java.lang.String expression) throws java.lang.NumberFormatException, java.lang.IllegalStateException, ParseException
expression
- to be calculated
ParseException
- if the syntax of the expression is invalid
java.lang.NumberFormatException
- if the parsing of numbers yields invalid
results
java.lang.IllegalStateException
- if the syntax tree is invalidpublic final void printSyntaxTree(java.lang.String expression, java.io.Writer out) throws ParseException, java.io.IOException
expression
- to be parsedout
- where to write the syntax tree
ParseException
- in case of syntax error
java.io.IOException
- in case of io error
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |