|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ijsberg.iglu.util.logic.LogicalElement
org.ijsberg.iglu.util.logic.Statement
org.ijsberg.iglu.util.logic.Expression
public class Expression
Logical expression, composed of statements and subexpressions that may be evaluated.
An expression that has been analyzed fully, contains 1 operator and a number of elements that may be evaluated accordingly.
| Field Summary |
|---|
| Fields inherited from class org.ijsberg.iglu.util.logic.Statement |
|---|
statement |
| Fields inherited from class org.ijsberg.iglu.util.logic.LogicalElement |
|---|
AND, NONE, NOT, operatorStr, OR |
| Constructor Summary | |
|---|---|
Expression(String expression)
Constructs an expression based on a logical expression defined in a string. |
|
Expression(String expression,
boolean useCache)
Constructs an expression based on a logical expression defined in a string. |
|
| Method Summary | |
|---|---|
static void |
clearCache()
Clears static expression cache. |
static int |
findEndOfSubExpression(String expression,
int start)
Finds the position of the end bracket ')' matching a start bracket '('. |
int |
getNrofElements()
|
String |
getStatement()
Performance optimizer: getStatement() in combination with isSingleStatement() isolates a single statement that can be evaluated immediately. |
boolean |
isSingleStatement()
|
boolean |
match(Object[] statements)
Answers questions like: does "r|w|x" match {"r","x"} (true). does "r|w&x" contain {"r","x"} (true). does "r|w&x" contain {"r"} (true). does "r|w&x" contain {"x"} (false). |
boolean |
match(String statement)
Answers questions like: does "r|w|x" match "x" (true). does "r|w&x" match "x" (false). |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Expression(String expression)
expression - Statement
public Expression(String expression,
boolean useCache)
expression - useCache - expressions will be cached in a static cache if trueStatement| Method Detail |
|---|
public static int findEndOfSubExpression(String expression,
int start)
expression - start - position of the start bracket
public boolean match(String statement)
statement -
public boolean match(Object[] statements)
match in class Statementstatements -
public String toString()
toString in class Statementpublic static void clearCache()
public int getNrofElements()
public boolean isSingleStatement()
public String getStatement()
getStatement in class Statement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||