Beispiel #1
0
 // Delete this NodeInfo.
 // Precondition: this.children.Count < 2
 public void Delete()
 {
     Debug.Assert(this.Children.Count < 2);
     if (this.Children.Count == 0)
     {
         foreach (NodeInfoEdge edge in this.Parents)
         {
             edge.Parent.Children.Remove(edge);
         }
     }
     else
     {
         QueryNodeInfo child = this.Children[0].Child;
         child.Parents.Remove(this.Children[0]);
         foreach (NodeInfoEdge edge in this.Parents)
         {
             NodeInfoEdge newEdge = new NodeInfoEdge(edge.Parent, child);
             NodeInfoEdge.UpdateEdge(edge.Parent.Children, edge, newEdge);
             child.Parents.Add(newEdge);
         }
     }
     
     this.Parents.Clear();
     this.Children.Clear();
 }