org.objectweb.medor.optim.lib
Class DropUselessNodeRule
java.lang.Object
|
+--org.objectweb.medor.optim.lib.BasicRule
|
+--org.objectweb.medor.optim.lib.DropUselessNodeRule
- All Implemented Interfaces:
- RewriteRule
- public class DropUselessNodeRule
- extends BasicRule
This rule removes the query node which are useless. A node is useless when
it have not filter and all fields are propagated fields which have only one
ancestor.
- Author:
- S.Chassande-Barrioz
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DropUselessNodeRule
public DropUselessNodeRule()
rewrite
public QueryTree rewrite(QueryTree qt)
throws MedorException
- Description copied from interface:
RewriteRule
- This method applies a single rule. It is typically called by the
QueryRewriter for applying the entire rewriting process.
- Specified by:
rewrite
in interface RewriteRule
- Overrides:
rewrite
in class BasicRule
- Parameters:
qt
- the QueryTree to be rewritten
- Returns:
- the rewritten QueryTree
- Throws:
MedorException
isUseless
protected DropUselessNodeRule.UsedFields isUseless(QueryTree qt)
throws MedorException
MedorException
replaceInFilter
protected boolean replaceInFilter(Expression e,
java.util.Map map)
throws MedorException
MedorException
replaceField
protected Field replaceField(QueryTreeField qtf,
java.util.Map map)
throws MedorException
MedorException