private void initializeRanges() { DominatorTreeNode node = this; DominatorTreeNode parent = (DominatorTreeNode) getParent(); while (parent != null) { node = parent; parent = (DominatorTreeNode) node.getParent(); } node.initializeRanges(0); }
private int initializeRanges(int i) { low = ++i; Enumeration<TreeNode> childEnum = getChildren(); while (childEnum.hasMoreElements()) { DominatorTreeNode child = (DominatorTreeNode) childEnum.nextElement(); i = child.initializeRanges(i); } high = ++i; return i; }
/** * This method returns true if the passed node dominates this node * * @param master the proposed dominating node * @return whether the passed node dominates me */ boolean isDominatedBy(DominatorTreeNode master) { if (low == 0) initializeRanges(); return master.low <= low && master.high >= high; }