public abstract class RowIterator extends Object implements Iterator<DataRow>
DataTable
.
Each DataTable has its specific RowIterator
, which returns
the rows one by one. A RowIterator
must return the rows always
in the same order.
Use RowIterators as follows:
DataTable table = ...; for (RowIterator it = table.getRowIterator(); it.hasNext();) { DataRow row = it.next(); ... }
or, if you don't need access to the iterator:
DataTable table =...; for (DataRow row : table) { // access the row here }
Note, the difference of this class to a generic Iterator<DataRow> is that it does not allow to remove elements.
DataRow
Constructor and Description |
---|
RowIterator() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
hasNext()
Returns
true if there are more rows and false
otherwise. |
abstract DataRow |
next()
Returns the next
DataRow . |
void |
remove()
NOT supported by the DataTable iterator! DataTables are immutable
read-only objects after their creation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public abstract boolean hasNext()
true
if there are more rows and false
otherwise.public abstract DataRow next()
DataRow
.next
in interface Iterator<DataRow>
DataTable
NoSuchElementException
- if there are no more rowspublic final void remove()
remove
in interface Iterator<DataRow>
UnsupportedOperationException
- if the remove
operation is not supported by this Iterator.
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.