📄 node.java
字号:
/* * Node.java * * Created on July 20, 2001, 12:18 AM * * See LICENSE file for license conditions. */package residue.graph;import java.util.*;import org.apache.bcel.generic.*;/** * This class is the node used in graphing control flow in * programs. * * @author Carl Howells * @version */public class Node extends Observable{ private Set edges; private int line; private InstructionHandle insHandle; private BasicBlock block; // position is only accurate before changes are made to the graph. private int pos; private int incomingEdges; public Node(InstructionHandle ih, int lnum) { line = lnum; insHandle = ih; edges = new HashSet(); pos = ih.getPosition(); } // Node public void addEdge(Node t) { if (edges.add(t)) t.incomingEdges++; } // addEdge public int getLine() { return line; } // getLine public InstructionHandle getInstruction() { return insHandle; } // getInstruction public int getPosition() { return pos; } // getPosition public int getNumberIncomingEdges() { return incomingEdges; } // getNumberIncomingEdges public void setBlock(BasicBlock b) { block = b; setChanged(); notifyObservers(b); } // setBlock public BasicBlock getBlock() { return block; } // getBlock /** * Returns a write protected version of the set of edges. */ public Set getEdges() { return Collections.unmodifiableSet(edges); } // getEdges } // class Node
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -