|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvec_math.BooleanParser
public class BooleanParser
A class providing arithmetics for booleans. Operators used are (sorted for precedence):
#valueOf method, it is parsed and the reslut, true or
false is returned. Parsing errors result in a
ParseException to be thrown. Please note that a
ParseException is not a runtime exception, therefore it
must be caught in calling routines.
| Nested Class Summary | |
|---|---|
static class |
BooleanParser.Test
Mainly test purpose. |
| Field Summary | |
|---|---|
private static List<Operator<String>> |
valid
All valid operators. |
| Constructor Summary | |
|---|---|
BooleanParser()
|
|
| Method Summary | |
|---|---|
static Boolean |
evaluateBoolean(String expression)
Parses the node and returns the expression as a Boolean object. |
private static String |
evaluateNode(Node<String> root)
Evaluates a node. |
private static String |
evaluateSingle(Operator<String> tie,
String left,
String right)
Evaluates a single boolean expression. |
protected static List<Operator<String>> |
getValid()
Returns all valid operator in this parsers context. |
static String |
parseBoolean(String expression)
Parses the given string to obtain a single boolean value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final List<Operator<String>> valid
| Constructor Detail |
|---|
public BooleanParser()
| Method Detail |
|---|
public static String parseBoolean(String expression)
throws ParseException
expression - A String combining boolean constants
ParseException - If the argument does not obey the specified
grammar.
public static Boolean evaluateBoolean(String expression)
throws ParseException
ParseExceptionprotected static List<Operator<String>> getValid()
private static String evaluateNode(Node<String> root)
throws ParseException
ParseException
private static String evaluateSingle(Operator<String> tie,
String left,
String right)
throws ParseException
ParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||