org.knime.base.data.append.row
Class AppendedRowsIterator

java.lang.Object
  extended by org.knime.core.data.RowIterator
      extended by org.knime.base.data.append.row.AppendedRowsIterator
All Implemented Interfaces:
Iterator<DataRow>

public class AppendedRowsIterator
extends RowIterator

Iterator over an AppendedRowsTable.

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
static class AppendedRowsIterator.RuntimeCanceledExecutionException
          Runtime exception that's thrown when the execution monitor's ExecutionMonitor.checkCanceled() method throws a CanceledExecutionException.
 
Constructor Summary
AppendedRowsIterator(DataTable[] tables, DataTableSpec spec, String suffix)
          Creates new iterator of tables following spec.
AppendedRowsIterator(DataTable[] tables, DataTableSpec spec, String suffix, ExecutionMonitor exec, int totalRowCount)
          Creates new iterator of tables following spec.
 
Method Summary
 Set<RowKey> getDuplicateHash()
          Deprecated. Use the key set of getDuplicateNameMap() instead.
 Map<RowKey,RowKey> getDuplicateNameMap()
          Get a map of keys in the resulting table to the keys in (any of) the input tables, typically elements such as below.
 int getNrRowsSkipped()
          Get the number of rows that have been skipped due to duplicate row keys.
 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

AppendedRowsIterator

AppendedRowsIterator(DataTable[] tables,
                     DataTableSpec spec,
                     String suffix)
Creates new iterator of tables following spec.

Parameters:
tables - to iterate over
spec - table spec of underlying table (used to determine missing columns and order)
suffix - the suffix to append to duplicate rows or null to skip duplicates in this iterator (prints warning)

AppendedRowsIterator

AppendedRowsIterator(DataTable[] tables,
                     DataTableSpec spec,
                     String suffix,
                     ExecutionMonitor exec,
                     int totalRowCount)
Creates new iterator of tables following spec. The iterator may throw an exception in next.

Parameters:
tables - to iterate over
spec - table spec of underlying table (used to determine missing columns and order)
suffix - the suffix to append to duplicate rows or null to skip duplicates in this iterator (prints warning)
exec - for progress/cancel, may be null
totalRowCount - the total row count or negative if unknown
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

getNrRowsSkipped

public int getNrRowsSkipped()
Get the number of rows that have been skipped due to duplicate row keys.

Returns:
Number of rows skipped.

getDuplicateHash

@Deprecated
public Set<RowKey> getDuplicateHash()
Deprecated. Use the key set of getDuplicateNameMap() instead.

Returns the set of all keys used in the resulting table.

Returns:
unmodifiable set of all keys

getDuplicateNameMap

public Map<RowKey,RowKey> getDuplicateNameMap()
Get a map of keys in the resulting table to the keys in (any of) the input tables, typically elements such as below.
KeyValue
Row1Row1
Row2Row2
Row1_dupRow1

Returns:
Such a map (unmodifiable)


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.