Example #1
0
 public bool MoveNext()
 {
     if (it != null)
     {
         if (!it.MoveNext())
         {
             if (left)
             {
                 it = null;
             }
             else
             {
                 return(false);
             }
         }
         return(true);
     }
     else
     {
         if (node.Right != null)
         {
             it   = node.Right.GetIterator();
             left = false;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Example #2
0
 public OysterTreeIterator(BSTNode n)
 {
     node = n;
     if (node.Left != null)
     {
         it = node.Left.GetIterator();
     }
     else
     {
         left = false;
     }
 }
Example #3
0
 public void Reset()
 {
     if (node.Left != null)
     {
         it   = node.Left.GetIterator();
         left = true;
     }
     else
     {
         it   = null;
         left = false;
     }
 }
Example #4
0
 public OysterDatabaseIterator(OysterDatabase d)
 {
     it = d.Reviews.GetIterator();
 }