org.objectweb.medor.optim.lib
Class PushNotInExpressionRule
- RewriteRule
public class PushNotInExpressionRule
This class is a RewriteRule implementation which vists a tree of QueryTree
in order to push the not operator in the filters.
Somes examples:
- !(a && b) is replaced by (!a || !b)
- !(a > b) is replaced by (a <= b)
- !(a = b) is replaced by (a != b)
- S. Chassande-Barrioz
PushNotInExpressionRule
public PushNotInExpressionRule()
pushNotInExpression
public BasicRule.ModifiedExpression pushNotInExpression(Expression e,
boolean hasANot)
throws MedorException
This recursive method push the Not operator in an expression.
e
- the current expression inside which the not operator must be
pushedhasANot
- is boolean which indicates if a not is currently being
push
MedorException
- if the expression is mal formed.
rewrite
public QueryTree rewrite(QueryTree qt,
QueryNode _parent)
throws MedorException
It modifies the expressions used as filter in a (tree of) QueryTree by pushing the
not operator.
Somes examples:
!(a && b) is replaced by (!a || !b)
!(a > b) is replaced by (a <= b)
!(a = b) is replaced by (a != b)
...
- rewrite in interface RewriteRule
qt
- is the query on which the rule must be applied
MedorException
- if filters are malforrmed