|
iiitAccessServer 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.iiit.access.server.plugins.parser.Parser
Provides a parser for operations on sets.
Every expression is evaluated from left to right. The operator '&' has a higher priority then '+' and '-'.
Examples:
A1 = { a1, a2 }
A2 = { a3, a4 }
A3 = { a5, a6 }
A12 = A1 + A2 = { a1, a2, a3, a4 }
A13 = A1 + A3 = { a1, a2, a5, a6 }
A23 = A2 + A3 = { a3, a4, a3, a4 }
A = A1 + A2 + A3 = { a1, a2, a3, a4, a5, a6 }
N = { }
A1 + A2 = A2 + A1 = { a1, a2, a3, a4 }
A1 + A1 = A1
A + A1 = A + A2 = A + A3 = A
A1 - A1 = N
A1 - A2 = A1
A1 - A = N
A - A1 - A2 = A - (A1 + A2) = A3
A - A1 = { a3, a4, a5, a6 }
A - A1 + A2 = (A - A1) + A2 = { a3, a4, a5, a6 }
A - A2 + A1 = (A - A2) + A1 = { a1, a2, a5, a6 }
A - (A1 + A2) = A - (A2 + A1) = A3
A + A1 - A2 = (A + A1) - A2 = { a1, a2, a5, a6 }
A + A2 - A1 = (A + A2) - A1 = { a3, a4, a5, a6 }
A + A1 - A1 = (A + A1) - A1 = { a3, a4, a5, a6 }
A - A1 + A1 = (A - A1) + A1 = { a1, a2, a3, a4, a5, a6 }
A1 - A = N
A1 - A2 = A1
A1 & A2 = N
A & N = N
A & A1 & A2 = (A & A1) & A2 = N
A & (A1 & A2) = N
(A1 + A2) & (A2 + A3) = (A2 + A1) & (A3 + A2) = A2
A1 + A2 & A2 + A3 = A1 + (A2 & A2) + A3 = A
A2 + A1 & A3 + A2 = A2 + (A1 & A3) + A2 = A2
A & A2 = A2 & A = A2
A1 & A2 = A2 & A1 = N
Constructor Summary | |
Parser()
Creates a new instance of Parser. |
|
Parser(ResolverPluginIf resolver)
Creates a new instance of Parser. |
Method Summary | |
Set |
evaluate(ParserStackIf argStack)
Evaluates the expression on top of argStack. |
Set |
evaluate(ParserStackIf argStack,
String name)
Evaluates the expression on top of argStack. |
Set |
evaluateExpression(String expression)
Evaluates an expression |
Set |
evaluateExpression(String expression,
String name)
Evaluates an expression. |
boolean |
getReturnEmptySets()
Retrieves whether the parser shall empty sets or null values when nothing was found. |
void |
setReturnEmptySets(boolean flag)
Sets whether the parser shall empty sets or null values when nothing was found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Parser()
public Parser(ResolverPluginIf resolver)
resolver
- The ResolverPlugin to use for the evaluations.Method Detail |
public void setReturnEmptySets(boolean flag)
flag
- true when empty sets shall be returned or false if null shall be returnedpublic boolean getReturnEmptySets()
public Set evaluate(ParserStackIf argStack, String name) throws ParserException
argStack
- This stack includes all expressions and subexpressions of the current tree
inside the orginal expression.name
- The name of the user for whom the expression should be evaluated.
ParserException
- if there is something wrong with the expression. The most common cases are syntax
errors or circular references within the expression.public Set evaluate(ParserStackIf argStack) throws ParserException
argStack
- This stack includes all expressions and subexpressions of the current tree
inside the orginal expression.
ParserException
- if there is something wrong with the expression. The most common cases are syntax
errors or circular references within the expression.public Set evaluateExpression(String expression, String name) throws ParserException
expression
- The expression to evaluatename
- The name of the user for whom the expression should be evaluated.
ParserException
- if there is something wrong with the expression. The most common cases are syntax
errors or circular references within the expression.public Set evaluateExpression(String expression) throws ParserException
expression
- The expression to evaluate
ParserException
- if there is something wrong with the expression. The most common cases are syntax
errors or circular references within the expression.
|
iiitAccessServer 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |