// move to the next element of the iteration public void Next() { //row 0/2/4... next number is left to right if (i == 0 || i % 2 == 0) { j++; } //row 1/3/5.. next number is right to left else { j--; } //index more than colum refering to row 0,2,4... turn to next row and start from last if (j >= collection.Columns()) { j = collection.Columns() - 1; i++; } //index negative number more than colum refering to row 1,3,5 ... turn to next row and start from first if (j <= -1) { j = 0; i++; } }
// move to the next element of the iteration public void Next() { j++; if (j >= collection.Columns()) { j = 0; i++; } }
// move to the next element of the iteration public void Next() { j++; if (j < collection.Columns() && collection.Get(i, j) == null) { Next(); } if (j >= collection.Columns()) { j = 0; i++; } }
// move to the next element of the iteration public void Next() { if (reverse) { j--; if (j < 0) { j = 0; i++; reverse = false; } } else { j++; if (j >= collection.Columns()) { j = collection.Columns() - 1; i++; reverse = true; } } }
// 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; } } }
// test whether or not the iteration has finished public bool IsDone() { return(j >= collection.Columns()); }