org.acm.seguin.refactor
Class DefaultComplexTransform

java.lang.Object
  extended by org.acm.seguin.refactor.DefaultComplexTransform
All Implemented Interfaces:
ComplexTransform

public class DefaultComplexTransform
extends java.lang.Object
implements ComplexTransform

Base class for a program that reads in an abstract syntax tree, transforms the code, and rewrites the file to disk.

Author:
Chris Seguin

Constructor Summary
DefaultComplexTransform()
          Constructor for the ComplexTransform object
 
Method Summary
 void add(TransformAST value)
          Adds a syntax tree transformation
 void apply(java.io.File inputFile, java.io.File outputFile)
          Given a file, applies a set of transformations to it
 void clear()
          Clears all the transforms
 void createFile(java.io.File file)
          Creates a new file
 boolean hasAnyChanges()
          Is it worth applying the transforms
 void removeFile(java.io.File file)
          Removes an old file
 void setUndoAction(UndoAction init)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComplexTransform

public DefaultComplexTransform()
Constructor for the ComplexTransform object

Parameters:
init - the undo action
Method Detail

setUndoAction

public void setUndoAction(UndoAction init)
Specified by:
setUndoAction in interface ComplexTransform

add

public void add(TransformAST value)
Adds a syntax tree transformation

Specified by:
add in interface ComplexTransform
Parameters:
value - Description of Parameter

clear

public void clear()
Clears all the transforms

Specified by:
clear in interface ComplexTransform

hasAnyChanges

public boolean hasAnyChanges()
Is it worth applying the transforms

Specified by:
hasAnyChanges in interface ComplexTransform
Returns:
true if there is any

apply

public void apply(java.io.File inputFile,
                  java.io.File outputFile)
Given a file, applies a set of transformations to it

Specified by:
apply in interface ComplexTransform
Parameters:
inputFile - Description of Parameter
outputFile - Description of Parameter

createFile

public void createFile(java.io.File file)
Creates a new file

Specified by:
createFile in interface ComplexTransform
Parameters:
file - Description of Parameter

removeFile

public void removeFile(java.io.File file)
Removes an old file

Specified by:
removeFile in interface ComplexTransform
Parameters:
file - Description of Parameter