+ private final GSS.Phase phase;
+ private final GSS.Phase predecessorPhase;
+ protected boolean destroyed = false;
+ private int numNonDoomedSuccessors = 0;
+ private boolean hasPathToRoot = false;
+
+ private FastSet<OtherNode> predecessors = new FastSet<OtherNode>();
+ private FastSet<OtherNode> successors = new FastSet<OtherNode>();
+ //protected HashSet<OtherNode> predecessors = new HashSet<OtherNode>();
+ //protected HashSet<OtherNode> successors = new HashSet<OtherNode>();
+
+ public GSS.Phase phase() { return phase; }
+ public GSS.Phase predecessorPhase() { return predecessorPhase; }
+ public boolean hasPredecessors() { return predecessors.size() > 0; }
+ public boolean hasSuccessors() { return successors.size() > 0; }
+ public boolean hasNonDoomedSuccessors() { return numNonDoomedSuccessors > 0; }
+
+ public boolean hasPathToRoot() { return hasPathToRoot; }
+ public void updatePathsToRootAfterRemoval() {
+ if (!hasPathToRoot()) return;
+ for(OtherNode on : predecessors)
+ if (on.hasPathToRoot())
+ return;
+ hasPathToRoot = false;
+ for(OtherNode on : successors)
+ on.updatePathsToRootAfterRemoval();
+ }
+