gumtree.spoon.diff.Diff Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gumtree-spoon-ast-diff Show documentation
Show all versions of gumtree-spoon-ast-diff Show documentation
Computes the AST difference between two Spoon abstract syntax trees using the Gumtree algorithm.
package gumtree.spoon.diff;
import gumtree.spoon.diff.operations.Operation;
import gumtree.spoon.diff.operations.OperationKind;
import spoon.reflect.declaration.CtElement;
import java.util.List;
/**
* represents a diff between two Spoon ASTs
*/
public interface Diff {
/**
* lists all operations (move,insert, deletes)
*/
List getAllOperations();
/**
* lists all operations such that the parent is not involved in the diff
*/
List getRootOperations();
/**
* lists all operations sub the given parent operation.
*/
List getOperationChildren(Operation operationParent, List rootOperations);
/**
* returns the changed node if there is a single one
*/
CtElement changedNode();
/**
* returns the first changed node of a given gumtree Operation class
*/
CtElement changedNode(Class extends Operation> operationWanted);
/**
* returns the common ancestor of all changes
*/
CtElement commonAncestor();
/**
* returns true if the diff contains a certain operation
*/
boolean containsOperation(OperationKind kind, String nodeKind);
/**
* returns true if the diff contains a certain operation where the initial node is labeled with nodeLabel
*/
boolean containsOperation(OperationKind kind, String nodeKind, String nodeLabel);
/**
* low level if you want to test on all operations and not only root operations
*/
boolean containsOperations(List operations, OperationKind kind, String nodeKind, String nodeLabel);
/**
* outputs debug information to System.out
*/
void debugInformation();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy