|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.data.RowIterator
org.knime.base.node.preproc.filter.row.RowFilterIterator
public class RowFilterIterator
Row iterator of the row filter table. Wraps a given row iterator and forwards
only rows that are approved by a given
RowFilter
. Also a
range of row numbers can be specified and a flag to only include or exclude
rows within that range. (The range feature is ANDed to the filter match
result. If another operation on the row number is required an appropreate
filter has to be created.)
The order of which the conditions are evaluated is as follows: If a range is
specified, the row number is checked against the specified range, only if it
matches the filter is asked to do its match. If the row number range fails it
is also checked if the end of the result table is reached due to the range
restrictions. (This should speed up the atEnd() check as we don't have to
traverse through the entire input table - which is actually the reason we
handle the row number range not in a filter.)
Note: Iterating may be slow as the iterator must potentially skip many rows
until it encounters a row to be returned. This iterator does also support
cancelation/progress information using an
ExecutionMonitor
.
Nested Class Summary | |
---|---|
static class |
RowFilterIterator.RuntimeCanceledExecutionException
Runtime exception that's thrown when the execution monitor's ExecutionMonitor.checkCanceled() method throws a
CanceledExecutionException . |
Constructor Summary | |
---|---|
RowFilterIterator(DataTable orig,
RowFilter filter)
Creates a new row iterator wrapping an existing one and delivering only rows that match the specified conditions. |
|
RowFilterIterator(DataTable origTable,
RowFilter filter,
ExecutionMonitor exec)
Creates a new row iterator wrapping an existing one and delivering only rows that match the specified conditions. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if there are more rows and false
otherwise. |
DataRow |
next()
This implementation may throw an RuntimeCanceledExecutionException if this class has been initialized with a non-null execution monitor. |
Methods inherited from class org.knime.core.data.RowIterator |
---|
remove |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RowFilterIterator(DataTable origTable, RowFilter filter, ExecutionMonitor exec)
origTable
- the original table from which we get the iterator and
the row count, if anyfilter
- a filter object that will decide whether rows are included
in the result or filtered outexec
- to report progress to and to check for cancel statuspublic RowFilterIterator(DataTable orig, RowFilter filter)
orig
- the original table from which we get the iterator and the row
count, if anyfilter
- a filter object that will decide whether rows are included
in the result or filtered outMethod Detail |
---|
public boolean hasNext()
true
if there are more rows and false
otherwise.
hasNext
in interface Iterator<DataRow>
hasNext
in class RowIterator
true
if the iterator has more elements, otherwise
false
RowIterator.next()
public DataRow next() throws RowFilterIterator.RuntimeCanceledExecutionException
DataRow
.
next
in interface Iterator<DataRow>
next
in class RowIterator
DataTable
RowFilterIterator.RuntimeCanceledExecutionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |