org.acm.seguin.refactor.type
Class MoveClass

java.lang.Object
  extended by org.acm.seguin.refactor.Refactoring
      extended by org.acm.seguin.refactor.type.MoveClass

public class MoveClass
extends Refactoring

Main program for repackaging. This object simply stores the main program and interprets the command line arguments for repackaging one or more files.

Author:
Chris Seguin

Field Summary
protected  java.util.LinkedList fileList
          The list of filenames
protected  java.lang.String initDir
          The directory
 
Fields inherited from class org.acm.seguin.refactor.Refactoring
ADD_CHILD, ADD_PARENT, EXTRACT_INTERFACE, EXTRACT_METHOD, MOVE_METHOD, PUSH_DOWN_FIELD, PUSH_DOWN_METHOD, PUSH_UP_ABSTRACT_METHOD, PUSH_UP_FIELD, PUSH_UP_METHOD, REMOVE_CLASS, RENAME_CLASS, RENAME_FIELD, RENAME_METHOD, RENAME_PARAMETER, REPACKAGE
 
Constructor Summary
protected MoveClass()
          Constructor for repackage
 
Method Summary
 void add(java.lang.String filename)
          Add a file to the list.
 java.lang.String getDescription()
          Gets the Description attribute of the MoveClass object
 int getID()
          Gets the id for this refactoring to track which refactorings are used.
protected  void preconditions()
          Main processing method for the MoveClass object
 void setDestinationPackage(java.lang.String dest)
          Set the destination package
 void setDirectory(java.lang.String dir)
          Set the directory
protected  void transform()
          Performs the transformation of the class
protected  void validateClassName(java.util.LinkedList inputFileList)
           
 
Methods inherited from class org.acm.seguin.refactor.Refactoring
checkDestinationFile, getComplexTransform, run, setComplexTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initDir

protected java.lang.String initDir
The directory


fileList

protected java.util.LinkedList fileList
The list of filenames

Constructor Detail

MoveClass

protected MoveClass()
Constructor for repackage

Method Detail

setDestinationPackage

public void setDestinationPackage(java.lang.String dest)
Set the destination package

Parameters:
dest - the package name

setDirectory

public void setDirectory(java.lang.String dir)
Set the directory

Parameters:
dir - the initial directory

getDescription

public java.lang.String getDescription()
Gets the Description attribute of the MoveClass object

Specified by:
getDescription in class Refactoring
Returns:
The Description value

getID

public int getID()
Gets the id for this refactoring to track which refactorings are used.

Specified by:
getID in class Refactoring
Returns:
the id

add

public void add(java.lang.String filename)
Add a file to the list. The file name includes only the name, and not the entire path.

Parameters:
filename - the file to add

preconditions

protected void preconditions()
                      throws RefactoringException
Main processing method for the MoveClass object

Specified by:
preconditions in class Refactoring
Throws:
RefactoringException - Description of Exception

transform

protected void transform()
Performs the transformation of the class

Specified by:
transform in class Refactoring

validateClassName

protected void validateClassName(java.util.LinkedList inputFileList)
                          throws RefactoringException
Throws:
RefactoringException