Esempio n. 1
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());
 }
Esempio n. 2
0
        // move to the next element of the iteration
        public void Next()
        {
            if (reversed)
            {
                j--;

                if (j < 0)
                {
                    j = 0;
                    i++;
                    reversed = false;
                }
            }
            else
            {
                j++;

                if (j >= collection.Columns())
                {
                    j = collection.Columns() - 1;
                    i++;
                    reversed = true;
                }
            }

            while (!IsDone())
            {
                if (Current() == null)
                {
                    Next();
                }
                else
                {
                    break;
                }
            }
        }
Esempio n. 3
0
        // move to the next element of the iteration
        public void Next()
        {
            j++;
            if (j >= collection.Columns())
            {
                j = 0;
                i++;
            }

            while (!IsDone())
            {
                if (Current() == null)
                {
                    Next();
                }
                else
                {
                    break;
                }
            }
        }