예제 #1
0
 // recursively initialize nodeDests from start node
 private void initNodeDests(SeqPhase phase, SeqNode n) throws Xcept {
   if (nodeDests.get(n) != null) return;
   if (stopAtFFTs && n.fft() != null) return;
   LinkedHashSet<SeqNode> dests = new LinkedHashSet<SeqNode>();
   nodeDests.put(n, dests);
   Iterator<SeqEdge> es = graph.getEdgesFrom(n);
   while (es.hasNext()) {
     SeqEdge e = es.next();
     SeqNode n1 = e.dest();
     dests.add(n1);
     if (phase != graph.getPhase(n1)) continue;
     if (stopAtFFTs && n1.fft() != null) continue;
     initNodeDests(phase, n1);
   }
 }
예제 #2
0
  // constructor
  public SeqGraphXcons(
      SeqGraph graph,
      LinkedHashSet<SeqNode> startNodes,
      LinkedHashSet<SeqNode> stopNodes,
      boolean stopAtFFTs)
      throws Xcept {
    this.graph = graph;
    this.startNodes = startNodes;
    this.stopNodes = stopNodes;
    this.stopAtFFTs = stopAtFFTs;

    System.err.println("SeqGraphXCons stopAtFFTs=" + stopAtFFTs);
    nodeDests = new Hashtable<SeqNode, LinkedHashSet<SeqNode>>();
    Iterator<SeqNode> ns = startNodes.iterator();
    while (ns.hasNext()) {
      SeqNode n = ns.next();
      SeqPhase p = graph.getPhase(n);
      initNodeDests(p, n);
    }
    System.err.println("  nodeDests=" + nodeDests);
  }