Class NodeLabeller

java.lang.Object
com.ibm.wala.cast.js.ipa.callgraph.correlations.extraction.NodeLabeller

public class NodeLabeller extends Object
A node labeller keeps a mapping from nodes to integers to allow consistent labelling of nodes.
Author:
mschaefer
  • Constructor Details

    • NodeLabeller

      public NodeLabeller()
  • Method Details

    • addNode

      public int addNode(CAstNode node)
      Adds a node to the mapping if it is not present yet.
      Parameters:
      node - the node to add
      Returns:
      the node's label
    • getLabel

      public int getLabel(CAstNode node)
      Determines the label of a node in the mapping.
      Parameters:
      node - the node whose label is to be determined
      Returns:
      if the node is mapped, returns its label; otherwise, returns -1
    • getNode

      public CAstNode getNode(int label)
      Determines the node associated with a given label.