+ public Set<GlobalFlowNode> getIncomingNodeSetByPrefix(Location prefix) {
+
+ Set<GlobalFlowNode> incomingNodeSet = new HashSet<GlobalFlowNode>();
+
+ for (Iterator iterator = getNodeSet().iterator(); iterator.hasNext();) {
+ GlobalFlowNode curNode = (GlobalFlowNode) iterator.next();
+ Set<GlobalFlowNode> outNodeSet = getOutNodeSet(curNode);
+
+ for (Iterator iterator2 = outNodeSet.iterator(); iterator2.hasNext();) {
+ GlobalFlowNode outNode = (GlobalFlowNode) iterator2.next();
+
+ if (outNode.getLocTuple().startsWith(prefix)) {
+ incomingNodeSet.add(curNode);
+ recurIncomingNodeSetByPrefix(prefix, curNode, incomingNodeSet);
+ }
+
+ }
+ }
+
+ return incomingNodeSet;
+
+ }
+
+ private void recurIncomingNodeSetByPrefix(Location prefix, GlobalFlowNode node,
+ Set<GlobalFlowNode> visited) {
+
+ Set<GlobalFlowNode> inNodeSet = getInNodeSet(node);
+
+ for (Iterator iterator = inNodeSet.iterator(); iterator.hasNext();) {
+ GlobalFlowNode curNode = (GlobalFlowNode) iterator.next();
+
+ if (!curNode.getLocTuple().startsWith(prefix) && !visited.contains(curNode)) {
+ visited.add(curNode);
+ recurIncomingNodeSetByPrefix(prefix, curNode, visited);
+ }
+ }
+
+ }
+
+ public Set<GlobalFlowNode> getReachableNodeSetByPrefix(Location prefix) {
+
+ Set<GlobalFlowNode> reachableNodeSet = new HashSet<GlobalFlowNode>();
+
+ for (Iterator iterator = getNodeSet().iterator(); iterator.hasNext();) {
+ GlobalFlowNode curNode = (GlobalFlowNode) iterator.next();
+
+ if (curNode.getLocTuple().startsWith(prefix)) {
+ Set<GlobalFlowNode> outNodeSet = getOutNodeSet(curNode);
+ for (Iterator iterator2 = outNodeSet.iterator(); iterator2.hasNext();) {
+ GlobalFlowNode outNode = (GlobalFlowNode) iterator2.next();
+ if (!outNode.getLocTuple().startsWith(prefix) && !reachableNodeSet.contains(outNode)) {
+ reachableNodeSet.add(outNode);
+ recurReachableNodeSetByPrefix(prefix, outNode, reachableNodeSet);
+ }
+
+ }
+ }
+ }
+
+ return reachableNodeSet;
+ }
+
+ private void recurReachableNodeSetByPrefix(Location prefix, GlobalFlowNode node,
+ Set<GlobalFlowNode> reachableNodeSet) {
+ Set<GlobalFlowNode> outNodeSet = getOutNodeSet(node);
+ for (Iterator iterator = outNodeSet.iterator(); iterator.hasNext();) {
+ GlobalFlowNode outNode = (GlobalFlowNode) iterator.next();
+ if (!outNode.getLocTuple().startsWith(prefix) && !reachableNodeSet.contains(outNode)) {
+ reachableNodeSet.add(outNode);
+ recurReachableNodeSetByPrefix(prefix, outNode, reachableNodeSet);
+ }
+ }
+ }
+