org.objectweb.medor.optim.lib
Class DropUnusedProjFieldsRule

java.lang.Object
  extended byorg.objectweb.medor.optim.lib.BasicRule
      extended byorg.objectweb.medor.optim.lib.DropUnusedProjFieldsRule
All Implemented Interfaces:
RewriteRule

public class DropUnusedProjFieldsRule
extends BasicRule

This class represents the rule to drop projected fields which are not used.

This rule is to be called on the root of the tree to be optimized. The projected fields of the root node will not be deleted (they are requested by the user).

As a remark, the user should be careful and not request unnecessary fields!


Nested Class Summary
 
Nested classes inherited from class org.objectweb.medor.optim.lib.BasicRule
BasicRule.ModifiedExpression
 
Field Summary
 
Fields inherited from class org.objectweb.medor.optim.lib.BasicRule
debug, log
 
Constructor Summary
DropUnusedProjFieldsRule()
           
 
Method Summary
 QueryTree rewrite(QueryTree qt, QueryNode _parent)
          Relies on a Map which associates to each child the list of required Fields for that child.
 
Methods inherited from class org.objectweb.medor.optim.lib.BasicRule
replaceUsage, rewrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropUnusedProjFieldsRule

public DropUnusedProjFieldsRule()
Method Detail

rewrite

public QueryTree rewrite(QueryTree qt,
                         QueryNode _parent)
                  throws MedorException
Relies on a Map which associates to each child the list of required Fields for that child.

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