astcentric.structure.transformation
Interface Transformation

All Known Implementing Classes:
AbstractTransformation, CreateNode, DeleteNode, MoveNode, RegisterNodeForExport, SetASTName, SetNodeName, SetNodeValue, SetReference, TransformationSequence

public interface Transformation

Interface for all transformation applicable to an AST.

Implementation can assume that both methods are invoked alternatively starting with transform(). That is, after transform() only undo() is allowed and vice versa.


Method Summary
 void transform(ScratchPad scratchPad, Feedback feedback)
          Performs the transformation.
 void undo()
          Reverts the transformation performed by the transform method.
 

Method Detail

transform

void transform(ScratchPad scratchPad,
               Feedback feedback)
Performs the transformation.

Parameters:
scratchPad - Scratch pad for objects needed between different transformations (e.g. copy-paste). Can be null if not needed. Implementations who need a scratch pad should throw an IllegalArgumentException if missing.
feedback - Call-back object for user feedback. Can be null.

undo

void undo()
Reverts the transformation performed by the transform method. After undoing the states of AST and ScratchPad have to be the same as before invoking transform().