org.objectweb.medor.optim.lib
Class PushSelectionRule
- RewriteRule
public class PushSelectionRule
This class represents the rule to push selections down a QueryTree.
PushSelectionRule
public PushSelectionRule()
extractMapFromExpression
public BasicRule.ModifiedExpression extractMapFromExpression(Expression e,
Map qt2e,
int op)
throws MedorException
This methods does two things. It extracts the expressions which can be
moved to a QueryTree child. The extracted expression are grouped by
QueryTree child in the Map parameter.
e
- is the expression in which sub expression could be extractedqt2e
- is a map result parameter which must be fill with the
the extractable sub expressions.
- a modifiedExpression instance. The 'isModified' field indicates
if the source expression has been modified ou replaced. The 'e' field
references the rest of the expression.
isSameQT
public PushSelectionRule.SameQT isSameQT(Expression e)
throws MedorException
It evaluates if inside an expression all QueryTreeField referenced in
FieldOperands come from the same QueryTree.
e
- is the expression in which the FieldOperand field will be
searched
- a SameQt instance. The 'isSame' field indicates if in the
given expression all Fields are linked to the same QueryTree. If 'isSame'
is true, the 'qt' field is the QueryTree with which all fieldoperand of
expression are linked.
merge
public BasicRule.ModifiedExpression merge(Expression origin,
Expression addExp,
int op)
It merges an source expresion with an additional expression.
origin
- is the source expressionaddExp
- is the additionnal expression which will be merge with the
source.
- a ModifiedExpression instance. The 'isModified' field indicates
if the source expression has been modified ou replaced. The 'e' field
references the result of the merge.