Beispiel #1
0
 /// <summary>
 /// Method is used to decompose the network and make sure
 /// the nodes are detached from each other.
 /// </summary>
 public override void removeAllSuccessors()
 {
     for (int idx = 0; idx < successorNodes.Length; idx++)
     {
         BaseNode bn = (BaseNode)successorNodes[idx];
         bn.removeAllSuccessors();
     }
     successorNodes = new BaseNode[0];
     useCount       = 0;
 }
Beispiel #2
0
        /// <summary> method to Clear the successors. method doesn't iterate over
        /// the succesors and Clear them individually.
        /// </summary>
        public virtual void clearSuccessors()
        {
            IEnumerator itr = successor2.GetEnumerator();

            while (itr.MoveNext())
            {
                BaseNode n = (BaseNode)itr.Current;
                n.removeAllSuccessors();
            }
            itr = entries.Values.GetEnumerator();
            while (itr.MoveNext())
            {
                BaseNode n = (BaseNode)itr.Current;
                n.removeAllSuccessors();
            }
            for (int idx = 0; idx < successorNodes.Length; idx++)
            {
                successorNodes[idx].removeAllSuccessors();
            }
            successor2.Clear();
            successorNodes = new BaseNode[0];
            entries.Clear();
        }