edu.wpi.cs.dsrg.utils
Class RewriteUtilities
java.lang.Object
|
+--edu.wpi.cs.dsrg.utils.RewriteUtilities
- public class RewriteUtilities
- extends java.lang.Object
This class includes all static functions used in the rewrite functionality.
- Since:
- 1.0
Constructor Summary |
RewriteUtilities()
The default RewriteUtilities constructor. |
Method Summary |
static void |
cleanXATAfterGeneration(XATTree tree)
This method will clean up the XATTree by doing following things:
. |
static void |
cleanXATAfterGeneration(XATTree tree,
boolean mergeTagger)
This method will clean up the XATTree by doing following things:
Get rid of the rename Operator. |
static boolean |
contains(Expression exp,
java.lang.String cname,
boolean replace,
java.lang.String newName)
This method looks if the given ColumnName is contained in the given expression. |
static boolean |
isDebug()
Get the value of the propertity 'DEBUG_DeepCopyMaker'. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
RewriteUtilities
public RewriteUtilities()
- The default RewriteUtilities constructor.
- Since:
- 1.0
cleanXATAfterGeneration
public static void cleanXATAfterGeneration(XATTree tree)
- This method will clean up the XATTree by doing following things:
. Get rid of the rename Operator.
. tagger merge
- Parameters:
tree
- The XATTree need cleanning.- Since:
- 1.0
cleanXATAfterGeneration
public static void cleanXATAfterGeneration(XATTree tree,
boolean mergeTagger)
- This method will clean up the XATTree by doing following things:
Get rid of the rename Operator.
- Parameters:
tree
- The XATTree need cleanning.mergeTagger
- True: Do tagger merge. False: otherwise.- Since:
- 1.0
contains
public static boolean contains(Expression exp,
java.lang.String cname,
boolean replace,
java.lang.String newName)
- This method looks if the given ColumnName is contained in the given expression.
If asked to replace, then found columnName is replaced with new column name provided.
This method can be useful in rewriting rules to check if any select, join etc node is refering to
a particular column generated below these nodes. You may want to modify the condition if you deleted
any nodes refered by expression in which case you want to replace the old column name with a new one.
- Parameters:
exp
- The given expression searching inside.cname
- The column name searching for.replace
- Indicate if found do replacement or not.newName
- The new column name used to replace the old column name.- Returns:
- boolean True: Found containing. False: otherwise.
- Since:
- 1.0
isDebug
public static boolean isDebug()
- Get the value of the propertity 'DEBUG_DeepCopyMaker'.
- Returns:
- boolean True: With debug information. False: No debug information.
- Since:
- 1.0