Пример #1
0
 private void assingPreds(
     MyNode v, HashSet<MyNode> preds, HashMap<MyNode, HashSet<MyNode>> nodeToPreds) {
   boolean isCritical = false;
   Iterator<MyEdge> it = v.getOutEdges();
   while (it.hasNext()) {
     MyEdge e = it.next();
     if (v.getOwner().isSpecial(e)) {
       if (!nodeToPreds.containsKey(v)) nodeToPreds.put(v, (HashSet<MyNode>) preds.clone());
       else nodeToPreds.get(v).addAll(preds);
       isCritical = true;
       break;
     }
   }
   if (isCritical) preds.add(v);
   it = v.getOutEdges();
   while (it.hasNext()) {
     MyEdge e = it.next();
     assingPreds(e.getTarget(), (HashSet<MyNode>) preds.clone(), nodeToPreds);
   }
 }
Пример #2
0
 private boolean isClusterNode(MyNode v) {
   MyEdge outEdge = v.getOutEdges().next();
   if (((HashSet<Integer>) outEdge.getInfo()).contains(-1)) return true;
   return false;
 }