Package org.jtool.slice
Class SliceCriterion
java.lang.Object
org.jtool.slice.SliceCriterion
An object that represents a slicing criterion.
-
Constructor Summary
ConstructorsConstructorDescriptionSliceCriterion
(DependencyGraph graph, PDGNode node, Set<JVariableReference> vars) Creates a new object that represents a slicing criterion.SliceCriterion
(DependencyGraph graph, PDGNode node, JVariableReference var) Creates a new object that represents a slicing criterion. -
Method Summary
Modifier and TypeMethodDescriptionstatic SliceCriterion
find
(DependencyGraph graph, JavaClass jclass, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.static SliceCriterion
find
(DependencyGraph graph, JavaField jfield, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.static SliceCriterion
find
(DependencyGraph graph, JavaFile jfile, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.static SliceCriterion
find
(DependencyGraph graph, JavaMethod jmethod, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.Returns the whole dependency graph to be sliced.getNode()
Returns a target node for this slicing criterion.Returns the collection of target variables for this slicing criterion.toString()
Obtains information on this slicing criterion.
-
Constructor Details
-
SliceCriterion
Creates a new object that represents a slicing criterion.- Parameters:
graph
- the whole dependency graph to be slicednode
- a target node for the slicing criterionvar
- a target variable for the slicing criterion
-
SliceCriterion
Creates a new object that represents a slicing criterion.- Parameters:
graph
- the whole dependency graph to be slicednode
- a target node for the slicing criterionvars
- the collection of target variables for this slicing criterion
-
-
Method Details
-
getDependencyGraph
Returns the whole dependency graph to be sliced.- Returns:
- the dependency graph
-
getNode
Returns a target node for this slicing criterion.- Returns:
- the node
-
getVariables
Returns the collection of target variables for this slicing criterion.- Returns:
- the variables
-
find
public static SliceCriterion find(DependencyGraph graph, JavaClass jclass, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.- Parameters:
graph
- the whole dependency graph to be slicedjclass
- a class containing a target variablelineNumber
- the line number of the location where a target variable existscolumnNumber
- the column number of the location where a target variable exists- Returns:
- the slicing criterion, or
null
if a valid slice criterion is not found
-
find
public static SliceCriterion find(DependencyGraph graph, JavaMethod jmethod, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.- Parameters:
graph
- the whole dependency graph to be slicedjmethod
- a method containing a target variablelineNumber
- the line number of the location where a target variable existscolumnNumber
- the column number of the location where a target variable exists- Returns:
- the slicing criterion, or
null
if a valid slice criterion is not found
-
find
public static SliceCriterion find(DependencyGraph graph, JavaField jfield, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.- Parameters:
graph
- the whole dependency graph to be slicedjfield
- a field containing a target variablelineNumber
- the line number of the location where a target variable existscolumnNumber
- the column number of the location where a target variable exists- Returns:
- the slicing criterion, or
null
if a valid slice criterion is not found
-
find
public static SliceCriterion find(DependencyGraph graph, JavaFile jfile, int lineNumber, int columnNumber) Finds a slicing criterion on a target variable at a given position on the source code.- Parameters:
graph
- the whole dependency graph to be slicedjfile
- a source file containing a target variablelineNumber
- the line number of the location where a target variable existscolumnNumber
- the column number of the location where a target variable exists- Returns:
- the slicing criterion, or
null
if a valid slice criterion is not found
-
toString
Obtains information on this slicing criterion.
-