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 does not have any 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,
QueryNode _parent)
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.
- Parameters:
qt
- the QueryTree to be rewritten_parent
- the parent QueryNode for which modification of propagated
field, if they are replaced in the qt, should be done.
- Returns:
- the rewritten QueryTree
- Throws:
MedorException
isUseless
protected DropUselessNodeRule.UsedFields isUseless(QueryTree qt)
throws MedorException
- Throws:
MedorException
replaceInFilter
protected boolean replaceInFilter(Expression e,
java.util.Map map)
throws MedorException
- Throws:
MedorException
replaceField
protected Field replaceField(QueryTreeField qtf,
java.util.Map map)
throws MedorException
- Throws:
MedorException