org.objectweb.medor.optim.lib
Class BasicRule

java.lang.Object
  extended byorg.objectweb.medor.optim.lib.BasicRule
All Implemented Interfaces:
RewriteRule
Direct Known Subclasses:
DropUnusedProjFieldsRule, DropUselessNodeRule, FlattenQueryTreeRule, GroupSameDBRule, PushNotInExpressionRule, PushSelectionRule, RdbAssignRdbAdapterRule

public abstract class BasicRule
extends java.lang.Object
implements RewriteRule

Author:
S. Chassande-Barrioz

Nested Class Summary
 class BasicRule.ModifiedExpression
          A ModifiedExpression is a structure containing an Expression and a boolean indicating whether the Expression has been modified or not.
 
Field Summary
protected  boolean debug
           
protected  Logger log
           
 
Constructor Summary
BasicRule()
           
BasicRule(java.lang.String suffix)
           
 
Method Summary
protected  void replaceUsage(QueryNode qn, java.util.Map old2neo)
           
 QueryTree rewrite(QueryTree qt)
          This method applies a single rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.medor.optim.api.RewriteRule
rewrite
 

Field Detail

log

protected Logger log

debug

protected boolean debug
Constructor Detail

BasicRule

public BasicRule()

BasicRule

public BasicRule(java.lang.String suffix)
Method Detail

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.

It is the same method, but the QueryTree to be rewritten is the top QueryTree (no parent).

Specified by:
rewrite in interface RewriteRule
Parameters:
qt - the QueryTree to be rewritten
Returns:
the rewritten QueryTree
Throws:
MedorException

replaceUsage

protected void replaceUsage(QueryNode qn,
                            java.util.Map old2neo)
                     throws MedorException
Throws:
MedorException