Class NodeLabeller
- java.lang.Object
-
- com.ibm.wala.cast.js.ipa.callgraph.correlations.extraction.NodeLabeller
-
public class NodeLabeller extends java.lang.ObjectA 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 intaddNode(com.ibm.wala.cast.tree.CAstNode node)Adds a node to the mapping if it is not present yet.intgetLabel(com.ibm.wala.cast.tree.CAstNode node)Determines the label of a node in the mapping.com.ibm.wala.cast.tree.CAstNodegetNode(int label)Determines the node associated with a given label.
-
-
-
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.
-
-