org.knime.core.data.container
Class ConcatenateTable

java.lang.Object
  extended by org.knime.core.data.container.ConcatenateTable
All Implemented Interfaces:
Iterable<DataRow>, DataTable, BufferedDataTable.KnowsRowCountTable

public final class ConcatenateTable
extends Object
implements BufferedDataTable.KnowsRowCountTable

Author:
Bernd Wiswedel, University of Konstanz

Method Summary
 void clear()
          Internal use.
static ConcatenateTable create(ExecutionMonitor mon, BufferedDataTable... tables)
          Creates a new table from argument tables.
static DataTableSpec createSpec(DataTableSpec... specs)
          Creates merged table spec.
 void ensureOpen()
          Internal use.
 DataTableSpec getDataTableSpec()
          Returns the DataTableSpec object of this table which gives information about the structure of this data table.
 BufferedDataTable[] getReferenceTables()
          Reference to the underlying tables, if any.
 int getRowCount()
          Row count of the table.
 CloseableRowIterator iterator()
          Overridden to narrow return type to closeable iterator.
static ConcatenateTable load(NodeSettingsRO s, DataTableSpec spec, Map<Integer,BufferedDataTable> tblRep)
          Restore table form node settings object.
 void putIntoTableRepository(HashMap<Integer,ContainerTable> rep)
          Put this table into the global table repository.
 void removeFromTableRepository(HashMap<Integer,ContainerTable> rep)
          Remove this table from global table repository.
 void saveToFile(File f, NodeSettingsWO s, ExecutionMonitor exec)
          Save the table to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clear

public void clear()
Internal use. Clears any allocated temporary files. The table won't be used anymore.

Specified by:
clear in interface BufferedDataTable.KnowsRowCountTable

ensureOpen

public void ensureOpen()
Internal use. Implementation of BufferedDataTable.ensureOpen().

Specified by:
ensureOpen in interface BufferedDataTable.KnowsRowCountTable

getReferenceTables

public BufferedDataTable[] getReferenceTables()
Reference to the underlying tables, if any. A reference table exists if this object is just a wrapper, such as a RearrangeColumnsTable or if this table concatenates a set of other tables.

Specified by:
getReferenceTables in interface BufferedDataTable.KnowsRowCountTable
Returns:
The reference table or null.

getRowCount

public int getRowCount()
Row count of the table.

Specified by:
getRowCount in interface BufferedDataTable.KnowsRowCountTable
Returns:
The row count.

getDataTableSpec

public DataTableSpec getDataTableSpec()
Returns the DataTableSpec object of this table which gives information about the structure of this data table.

Specified by:
getDataTableSpec in interface DataTable
Returns:
the DataTableSpec of this table

iterator

public CloseableRowIterator iterator()
Overridden to narrow return type to closeable iterator. Returns a row iterator which returns each row one-by-one from the table.

Specified by:
iterator in interface Iterable<DataRow>
Specified by:
iterator in interface DataTable
Specified by:
iterator in interface BufferedDataTable.KnowsRowCountTable
Returns:
row iterator
See Also:
DataRow

putIntoTableRepository

public void putIntoTableRepository(HashMap<Integer,ContainerTable> rep)
Put this table into the global table repository. Called when execution finished.

Specified by:
putIntoTableRepository in interface BufferedDataTable.KnowsRowCountTable
Parameters:
rep - The workflow table repository.

removeFromTableRepository

public void removeFromTableRepository(HashMap<Integer,ContainerTable> rep)
Remove this table from global table repository. Called when node is reset.

Specified by:
removeFromTableRepository in interface BufferedDataTable.KnowsRowCountTable
Parameters:
rep - The workflow table repository.

saveToFile

public void saveToFile(File f,
                       NodeSettingsWO s,
                       ExecutionMonitor exec)
                throws IOException,
                       CanceledExecutionException
Save the table to a file.

Specified by:
saveToFile in interface BufferedDataTable.KnowsRowCountTable
Parameters:
f - To write to.
s - To add meta information to.
exec - For progress/cancel.
Throws:
IOException - If writing fails.
CanceledExecutionException - If canceled.

load

public static ConcatenateTable load(NodeSettingsRO s,
                                    DataTableSpec spec,
                                    Map<Integer,BufferedDataTable> tblRep)
                             throws InvalidSettingsException
Restore table form node settings object.

Parameters:
s - Containing information.
spec - Associated spec.
tblRep - For table lookup
Returns:
The newly instantiated table.
Throws:
InvalidSettingsException - If information is invalid.

create

public static ConcatenateTable create(ExecutionMonitor mon,
                                      BufferedDataTable... tables)
                               throws CanceledExecutionException
Creates a new table from argument tables.

Parameters:
mon - for progress info/cancellation
tables - Tables to put together.
Returns:
The new table.
Throws:
CanceledExecutionException - If cancelled.

createSpec

public static DataTableSpec createSpec(DataTableSpec... specs)
Creates merged table spec.

Parameters:
specs - the argument tables.
Returns:
the new spec
See Also:
DataTableSpec.mergeDataTableSpecs(DataTableSpec...)


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.