Class SliceCriterion

java.lang.Object
org.jtool.slice.SliceCriterion

public class SliceCriterion extends Object
An object that represents a slicing criterion.
  • Constructor Details

    • SliceCriterion

      public SliceCriterion(DependencyGraph graph, PDGNode node, JVariableReference var)
      Creates a new object that represents a slicing criterion.
      Parameters:
      graph - the whole dependency graph to be sliced
      node - a target node for the slicing criterion
      var - a target variable for the slicing criterion
    • SliceCriterion

      public SliceCriterion(DependencyGraph graph, PDGNode node, Set<JVariableReference> vars)
      Creates a new object that represents a slicing criterion.
      Parameters:
      graph - the whole dependency graph to be sliced
      node - a target node for the slicing criterion
      vars - the collection of target variables for this slicing criterion
  • Method Details

    • getDependencyGraph

      public DependencyGraph getDependencyGraph()
      Returns the whole dependency graph to be sliced.
      Returns:
      the dependency graph
    • getNode

      public PDGNode getNode()
      Returns a target node for this slicing criterion.
      Returns:
      the node
    • getVariables

      public Set<JVariableReference> 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 sliced
      jclass - a class containing a target variable
      lineNumber - the line number of the location where a target variable exists
      columnNumber - 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 sliced
      jmethod - a method containing a target variable
      lineNumber - the line number of the location where a target variable exists
      columnNumber - 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 sliced
      jfield - a field containing a target variable
      lineNumber - the line number of the location where a target variable exists
      columnNumber - 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 sliced
      jfile - a source file containing a target variable
      lineNumber - the line number of the location where a target variable exists
      columnNumber - 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

      public String toString()
      Obtains information on this slicing criterion.
      Overrides:
      toString in class Object
      Returns:
      the string representing the information