Composite Refactoring
v1.0

compositeRefactoring.refactoringComposite
Class RefactoringComposite_IteratorImpl

java.lang.Object
  |
  +--compositeRefactoring.refactoringComposite.RefactoringComponent
        |
        +--compositeRefactoring.refactoringComposite.RefactoringComposite
              |
              +--compositeRefactoring.refactoringComposite.RefactoringComposite_IteratorImpl
All Implemented Interfaces:
IRefactoring

public class RefactoringComposite_IteratorImpl
extends RefactoringComposite
implements IRefactoring

This class is an implementation of RefactoringComposite with an Iterator Pattern.


Fields inherited from class compositeRefactoring.refactoringComposite.RefactoringComposite
DEFAULTNAME
 
Fields inherited from class compositeRefactoring.refactoringComposite.RefactoringComponent
fName
 
Constructor Summary
RefactoringComposite_IteratorImpl(RefactoringComponent[] comps)
          creates a new RefactoringComposite_IteratorImpl object with a default name.
RefactoringComposite_IteratorImpl(String name, RefactoringComponent[] comps)
          creates a new RefactoringComposite_IteratorImpl object.
 
Method Summary
 RefactoringStatus checkPreconditions(IProgressMonitor pm)
          checks the Preconditions of the refactoring.
 IChange createChange(IProgressMonitor pm)
          creates the change which is to be executed when performing the refactoring.
 Iterator iterator()
          creates an instance of an Iterator with which the composite's components can be visited.
 RefactoringStatus refactor()
          this method performs the composite refactoring.
 Iterator stack()
          creates an instance of a Stack with which the composite's components can be visited from top to bottom.
 RefactoringStatus undo()
          this method undos the composite refactoring when it was performed.
 
Methods inherited from class compositeRefactoring.refactoringComposite.RefactoringComponent
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jdt.internal.corext.refactoring.base.IRefactoring
getName
 

Constructor Detail

RefactoringComposite_IteratorImpl

public RefactoringComposite_IteratorImpl(RefactoringComponent[] comps)
creates a new RefactoringComposite_IteratorImpl object with a default name.
Parameters:
comps - the RefactoringComponent s of this composite.

RefactoringComposite_IteratorImpl

public RefactoringComposite_IteratorImpl(String name,
                                         RefactoringComponent[] comps)
creates a new RefactoringComposite_IteratorImpl object.
Parameters:
name - the name of the RefactoringComposite.
comps - the RefactoringComponent s of this composite.
Method Detail

iterator

public Iterator iterator()
creates an instance of an Iterator with which the composite's components can be visited.
Returns:
the Iterator for the composite's components.

stack

public Iterator stack()
creates an instance of a Stack with which the composite's components can be visited from top to bottom.
Returns:
the Stack for the composite's components.

refactor

public RefactoringStatus refactor()
this method performs the composite refactoring.
Overrides:
refactor in class RefactoringComposite
Returns:
the status of the performed refactoring

undo

public RefactoringStatus undo()
this method undos the composite refactoring when it was performed.
Overrides:
undo in class RefactoringComposite
Returns:
the status of the Undo

checkPreconditions

public RefactoringStatus checkPreconditions(IProgressMonitor pm)
                                     throws JavaModelException
checks the Preconditions of the refactoring. This method calls an Iterator which calls the checkPrecondition methods of the RefactoringComposite children.
Specified by:
checkPreconditions in interface IRefactoring
Overrides:
checkPreconditions in class RefactoringComposite
Parameters:
pm - an IProgressMonitor to monitor the method's progress
Returns:
the status of the checks.

createChange

public IChange createChange(IProgressMonitor pm)
                     throws JavaModelException
creates the change which is to be executed when performing the refactoring. This change will not be performed, the method exists just for extensibility and information! It is never called by a client currently.
Specified by:
createChange in interface IRefactoring
Overrides:
createChange in class RefactoringComposite
Parameters:
pm - an IProgressMonitor to monitor the method's progress
Returns:
the actual change

Composite Refactoring
v1.0