org.knime.core.data.container
Class JoinTableIterator

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

 class JoinTableIterator
extends CloseableRowIterator

Internal iterator class that concatenates two rows. The iterator assumes that both underlying iterators return the row keys in the same order. No check is done.

Author:
wiswedel, University of Konstanz

Constructor Summary
JoinTableIterator(CloseableRowIterator itReference, CloseableRowIterator itAppended, int[] map, boolean[] flags)
          Creates new iterator based on two iterators.
 
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

JoinTableIterator

JoinTableIterator(CloseableRowIterator itReference,
                  CloseableRowIterator itAppended,
                  int[] map,
                  boolean[] flags)
Creates new iterator based on two iterators.

Parameters:
itReference - The reference iterator, providing the keys, e.g.
itAppended - The row to be appended.
map - The internal map which columns are contributed from what iterator
flags - The flags from which row to use.
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.