node.java~
来自「该工具也是用于字节码插桩」· JAVA~ 代码 · 共 88 行
JAVA~
88 行
/* * Node.java * * Created on July 20, 2001, 12:18 AM * * See LICENSE file for license conditions. */package residue.graph;import java.util.*;import de.fub.bytecode.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 + =
减小字号Ctrl + -
显示快捷键?