|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.christopherschultz.evaluator.Expression
net.christopherschultz.evaluator.NegatedExpression
public class NegatedExpression
An Expression to perform a logical negation (i.e. NOT) of a sub-expression.
| Constructor Summary | |
|---|---|
NegatedExpression(Expression subExpression)
Creates a new NegatedExpression with the given sub-expression. |
|
| Method Summary | |
|---|---|
void |
acceptVisitor(ExpressionVisitor visitor)
Accepts an ExpressionVisitor. |
boolean |
equals(Object o)
Returns true if the specified object is equal to
this one. |
Object |
evaluate(EvaluationContext ec)
Evaluates this Expression by returning the logical negation of the sub-expression. |
Expression |
getSubExpression()
Gets the Expression which is being negated by this one. |
List |
getSubExpressions()
Returns a list containing this NegatedExpression and the expression to be negated (in that order). |
int |
hashCode()
Returns the hash code for this NegatedExpression. |
String |
toString()
Returns a String representation of this NegatedExpression. |
| Methods inherited from class net.christopherschultz.evaluator.Expression |
|---|
getParent, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NegatedExpression(Expression subExpression)
throws EvaluationException
subExpression - The expression whose result will be logically
negated when evaluated.
IllegalArgumentException - If the sub expression is null.
EvaluationException| Method Detail |
|---|
public Object evaluate(EvaluationContext ec)
throws EvaluationException
evaluate in class Expressionec - The EvaluationContext in which this expression should
be evaluated.
EvaluationException - If the sub-expression fails evaluation,
or does not return a Boolean value.public Expression getSubExpression()
public List getSubExpressions()
getSubExpressions in class Expressionpublic void acceptVisitor(ExpressionVisitor visitor)
Expression
acceptVisitor in class Expressionpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic boolean equals(Object o)
true if the specified object is equal to
this one.
equals in class Objecto - The object to test for equality.
true if the specified object is equal to
this one, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||