org.knime.core.data.def
Class DefaultRowIterator

java.lang.Object
  extended by org.knime.core.data.RowIterator
      extended by org.knime.core.data.def.DefaultRowIterator
All Implemented Interfaces:
Iterator<DataRow>

public class DefaultRowIterator
extends RowIterator

Specific implementation for a RowIterator that iterates over a generic DataTable. It delegates to a given Iterator<DataRow>; but disallows the invocation of the remove method.

Author:
Bernd Wiswedel, University Konstanz

Constructor Summary
DefaultRowIterator(DataRow... rows)
          Constructs a new iterator that traverses an array of DataRow.
DefaultRowIterator(Iterable<DataRow> iterable)
          Constructs a new iterator based on an Iterable.
 
Method Summary
 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

DefaultRowIterator

public DefaultRowIterator(Iterable<DataRow> iterable)
Constructs a new iterator based on an Iterable.

Parameters:
iterable - the underlying iterable row container.
Throws:
NullPointerException - if the argument is null.

DefaultRowIterator

public DefaultRowIterator(DataRow... rows)
Constructs a new iterator that traverses an array of DataRow.

Parameters:
rows - the array to iterate over.
Throws:
NullPointerException - if the argument is null.
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


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.