Class NodeLabeller


  • public class NodeLabeller
    extends java.lang.Object
    A node labeller keeps a mapping from nodes to integers to allow consistent labelling of nodes.
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeLabeller()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int addNode​(com.ibm.wala.cast.tree.CAstNode node)
      Adds a node to the mapping if it is not present yet.
      int getLabel​(com.ibm.wala.cast.tree.CAstNode node)
      Determines the label of a node in the mapping.
      com.ibm.wala.cast.tree.CAstNode getNode​(int label)
      Determines the node associated with a given label.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeLabeller

        public NodeLabeller()
    • Method Detail

      • addNode

        public int addNode​(com.ibm.wala.cast.tree.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​(com.ibm.wala.cast.tree.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 com.ibm.wala.cast.tree.CAstNode getNode​(int label)
        Determines the node associated with a given label.