@Override public Iterator<MatrixEntry> iterator() { return new MatrixIterator(this); }
@Override final public MatrixEntry next() { if (!hasNext()) { throw new NoSuchElementException("Iterator has exceeded the bounds " + "of the matrix"); } // Get the current value BaseMatrixEntry result = new BaseMatrixEntry(matrix, rowIndex, columnIndex); // Go to the next value ++columnIndex; // Roll to the next row if (columnIndex >= matrix.getNumColumns()) { columnIndex = 0; ++rowIndex; } return result; }
@Override final public MatrixEntry next() { if (!hasNext()) { throw new NoSuchElementException("Iterator has exceeded the bounds " + "of the matrix"); } // Get the current value BaseMatrixEntry result = new BaseMatrixEntry(matrix, rowIndex, columnIndex); // Go to the next value ++columnIndex; // Roll to the next row if (columnIndex >= matrix.getNumColumns()) { columnIndex = 0; ++rowIndex; } return result; }
@Override public Iterator<MatrixEntry> iterator() { return new MatrixIterator(this); }
@Override final public MatrixEntry next() { if (!hasNext()) { throw new NoSuchElementException("Iterator has exceeded the bounds " + "of the matrix"); } // Get the current value BaseMatrixEntry result = new BaseMatrixEntry(matrix, rowIndex, columnIndex); // Go to the next value ++columnIndex; // Roll to the next row if (columnIndex >= matrix.getNumColumns()) { columnIndex = 0; ++rowIndex; } return result; }
@Override public Iterator<MatrixEntry> iterator() { return new MatrixIterator(this); }