org.knime.base.data.filter.column
Class CloseableFilterColumnRowIterator

java.lang.Object
  extended by org.knime.core.data.RowIterator
      extended by org.knime.core.data.container.CloseableRowIterator
          extended by org.knime.base.data.filter.column.CloseableFilterColumnRowIterator
All Implemented Interfaces:
Iterator<DataRow>

final class CloseableFilterColumnRowIterator
extends CloseableRowIterator

Filter column row iterator needed to wrap the filter column's original row iterator. In contrast to the FilterColumnRowIterator this iterator is closeable.

Author:
Thomas Gabriel, University of Konstanz, Thorsten Meinl, University of Konstanz
See Also:
FilterColumnTable

Constructor Summary
CloseableFilterColumnRowIterator(CloseableRowIterator it, int[] columns)
          Creates a new filter iterator using the original row iterator and an array of column indices.
 
Method Summary
 void close()
          Closes this iterator.
 boolean hasNext()
          Returns true if there are more rows and false otherwise.
 DataRow next()
          Returns the next DataRow.
 
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

CloseableFilterColumnRowIterator

CloseableFilterColumnRowIterator(CloseableRowIterator it,
                                 int[] columns)
Creates a new filter iterator using the original row iterator and an array of column indices.

Parameters:
it - the original row iterator
columns - an array of column indices
Method Detail

hasNext

public boolean hasNext()
Returns true if there are more rows and false otherwise.

Specified by:
hasNext in interface Iterator<DataRow>
Specified by:
hasNext in class RowIterator
Returns:
true if the iterator has more elements, otherwise false
See Also:
RowIterator.next()

next

public DataRow next()
Returns the next DataRow.

Specified by:
next in interface Iterator<DataRow>
Specified by:
next in class RowIterator
Returns:
the next row in the DataTable

close

public void close()
Closes this iterator. Subsequent calls of RowIterator.hasNext() will return false. This method does not need to be called if the iterator was pushed to the end (stream will be closed automatically). It's meant to be used in cases where the iterator might not advance to the end of the table.

This method does nothing if the table is already closed (multiple invocations are ignored).

Specified by:
close in class CloseableRowIterator


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
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.