Exemple #1
0
 // move to the next element of the iteration
 public void Next()
 {
     // Console.WriteLine("row = " + i + " col = " + j);
     if (i % 2 == 0)
     {
         if (j >= collection.Rows())
         {
             i++;
             j = 2;
         }
         else
         {
             j++;
         }
     }
     else
     {
         if (j == 0)
         {
             i++;
             j = 0;
         }
         else
         {
             j--;
         }
     }
 }
Exemple #2
0
 // constructor
 public RowReverseIteractorGeneric(TwoDArrayGeneric <T> collectionIn)
 {
     collection = collectionIn;
     i          = 0;
     j          = 0;
     Console.WriteLine("total col = " + collection.Columns());
     Console.WriteLine("total row = " + collection.Rows());
 }
Exemple #3
0
 // test whether or not the iteration has finished
 public bool IsDone()
 {
     return(i >= collection.Rows());
 }