Class Slice

java.lang.Object
org.jtool.slice.Slice

public class Slice extends Object
An object storing information on a program slice.
  • Constructor Details

    • Slice

      public Slice(SliceCriterion criterion)
      Creates a new object that represents a slice.
      Parameters:
      criterion - a slicing criterion that derives this slice.
  • Method Details

    • getDependencyGraph

      public DependencyGraph getDependencyGraph()
      Returns a dependency graph containing the target PDG.
      Returns:
      the dependency graph
    • getCriterionNode

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

      public Set<JVariableReference> getCriterionVariables()
      Returns the collection of target variables for this slicing criterion.
      Returns:
      the variables
    • getNodes

      public Set<PDGNode> getNodes()
      Obtains PDG nodes that contained in this slice.
      Returns:
      the collection of the PDG nodes
    • getCode

      public String getCode(JavaClass jclass)
      Obtains source code that constitutes this slice.
      Parameters:
      jclass - a program element that encloses the source code
      Returns:
      the contents of the source code
    • getCode

      public String getCode(JavaClass jclass, Map<String,String> options)
      Obtains source code that constitutes this slice.
      Parameters:
      jclass - a program element that encloses the source code
      options - the options for formatting the source code
      Returns:
      the contents of the source code
    • getCode

      public String getCode(JavaMethod jmethod)
      Obtains source code that constitutes this slice.
      Parameters:
      jmethod - a program element that encloses the source code
      Returns:
      the contents of the source code
    • getCode

      public String getCode(JavaMethod jmethod, Map<String,String> options)
      Obtains source code that constitutes this slice.
      Parameters:
      jmethod - a program element that encloses the source code
      options - the options for formatting the source code
      Returns:
      the contents of the source code
    • getCode

      public String getCode(JavaField jfield)
      Obtains source code that constitutes this slice.
      Parameters:
      jfield - a program element that encloses the source code
      Returns:
      the contents of the source code
    • getCode

      public String getCode(JavaField jfield, Map<String,String> options)
      Obtains source code that constitutes this slice.
      Parameters:
      jfield - a program element that encloses the source code
      options - the options for formatting the source code
      Returns:
      the contents of the source code
    • print

      public void print()
      Displays information on this slice.
    • toString

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