org.knime.core.data.def
Class DefaultTable

java.lang.Object
  extended by org.knime.core.data.def.DefaultTable
All Implemented Interfaces:
Iterable<DataRow>, DataTable

Deprecated. DefaultTable will hold the entire data in main memory and should therefore not be used anymore. Instead, you should consider to use a DataContainer (or in a Node's execute method a BufferedDataTable to create DataTables).

public class DefaultTable
extends Object
implements DataTable

Deprecated(!) default implementation of a DataTable object. This implementation keeps the data in memory all the time. Don't use it. We have better containers: rather use the DataContainer.

Author:
Bernd Wiswedel, University of Konstanz

Constructor Summary
DefaultTable(DataRow[] rows, DataTableSpec spec)
          Deprecated. Creates a new table object from an array of DataRow objects, and an array of column names and types.
DefaultTable(DataRow[] rows, String[] columnNames, DataType[] columnTypes)
          Deprecated. Creates a new table object from an array of DataRow objects, and an array of column names and types.
DefaultTable(double[][] data)
          Deprecated. Calls this(data, (String[])null, (String[])null);.
DefaultTable(double[][] data, String[] rowHeader, String[] colHeader)
          Deprecated. Generates a new instance from an double[][] using the default DataCell factory.
DefaultTable(int[][] data)
          Deprecated. Calls this(data, (String[])null, (String[])null);.
DefaultTable(int[][] data, String[] rowHeader, String[] colHeader)
          Deprecated. Generates a new instance from an int[][] using the default DataCell factory.
DefaultTable(Object[][] data)
          Deprecated. Calls this(data, (String[])null, (String[])null);.
DefaultTable(Object[][] data, String[] rowHeader, String[] colHeader)
          Deprecated. Generates a new instance from an Object[][] using the default DataCell factory.
DefaultTable(Object[][] data, String[] rowHeader, String[] colHeader, ObjectToDataCellConverter conv)
          Deprecated. Generates a new instance from an Object[][].
 
Method Summary
 DataTableSpec getDataTableSpec()
          Deprecated. Returns the DataTableSpec object of this table which gives information about the structure of this data table.
 int getRowCount()
          Deprecated. Get the number of rows in this table.
protected  List<DataRow> getRowsInList()
          Deprecated. Get a reference to underlying data container.
 RowIterator iterator()
          Deprecated. Returns a row iterator which returns each row one-by-one from the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTable

public DefaultTable(DataRow[] rows,
                    DataTableSpec spec)
Deprecated. 
Creates a new table object from an array of DataRow objects, and an array of column names and types.

Parameters:
rows - The list of DataRow objects.
spec - The Spec of this table.
Throws:
NullPointerException - If one of the arguments is null, or if the array contains null values.
IllegalArgumentException - If any runtime class in the row's cells does not comply with the settings in the spec.

DefaultTable

public DefaultTable(DataRow[] rows,
                    String[] columnNames,
                    DataType[] columnTypes)
Deprecated. 
Creates a new table object from an array of DataRow objects, and an array of column names and types.

Parameters:
rows - The list of DataRow objects.
columnNames - The names of the columns.
columnTypes - The column types.
Throws:
NullPointerException - If one of the arguments is null, or if any array contains null values.
IllegalStateException - If redundant column names are found.
IllegalArgumentException - If any element in columnTypes is not a (sub-)class of DataCell.class or the runtime class for an element of the corresponding cells in rows is a supertype of its columnTypes counterpart.

DefaultTable

public DefaultTable(Object[][] data,
                    String[] rowHeader,
                    String[] colHeader,
                    ObjectToDataCellConverter conv)
Deprecated. 
Generates a new instance from an Object[][]. The data is provided in a parameter array containing Objects that are known by the given converter's createDataCell(Object) method. The column type is determined by the most specific DataCell class for all cells in a column.

Parameters:
data - Content of the table, all rows must have same length, null values are ok to indicate missing values.
rowHeader - The name of the rows in an array. May be null. The length of the array (if given) must match data.length.
colHeader - The name of the columns in an array. May be null. The length of the array (if given) must match data[r].length for any given r.
conv - Used to transform any object in data to a DataCell
Throws:
IllegalArgumentException - In the following cases:
  • data is null
  • data.length != rowHeader.length if rowHeader is given (non-null)
  • if length of colHeader (if not null) is unequal to the length of any row in data
  • if any object in data cannot be handled by converter.
See Also:
DataType.getCommonSuperType(DataType, DataType)

DefaultTable

public DefaultTable(Object[][] data,
                    String[] rowHeader,
                    String[] colHeader)
Deprecated. 
Generates a new instance from an Object[][] using the default DataCell factory. That is, data may only contain objects of type String, Integer, Byte, Double, Float or null to identify missing values. See the factory implementation, ObjectToDataCellConverter.createDataCell(Object), for details. The column type is determined by the most specific DataCell class for all cells in a column.

Parameters:
data - Content of the table, all rows must have same length, null values are ok to indicate missing values.
rowHeader - The name of the rows in an array. May be null. The length of the array (if given) must match data.length.
colHeader - The name of the columns in an array. May be null. The length of the array (if given) must match data[r].length for any given r.
Throws:
IllegalArgumentException - In the following cases:
  • data is null
  • data.length != rowHeader.length if rowHeader is given (non-null)
  • if length of colHeader (if not null) is unequal to the length of any row in data
  • if any object in data cannot be handled by converter.
See Also:
DataType.getCommonSuperType(DataType, DataType)

DefaultTable

public DefaultTable(Object[][] data)
Deprecated. 
Calls this(data, (String[])null, (String[])null);.

Parameters:
data - Data to be set in this table. For further details see other constructor
See Also:
DefaultTable(Object[][], String[], String[])

DefaultTable

public DefaultTable(int[][] data,
                    String[] rowHeader,
                    String[] colHeader)
Deprecated. 
Generates a new instance from an int[][] using the default DataCell factory. All entries in this parameter array are wrapped by an IntCell by calling ObjectToDataCellConverter.createDataCell(new Integer(data[i][j])

Parameters:
data - Content of the table, all rows must have same length.
rowHeader - The name of the rows in an array. May be null. The length of the array (if given) must match data.length.
colHeader - The name of the columns in an array. May be null. The length of the array (if given) must match data[r].length for any given r.
Throws:
IllegalArgumentException - In the following cases:
  • data is null
  • data.length != rowHeader.length if rowHeader is given (non-null)
  • if length of colHeader (if not null) is unequal to the length of any row in data
  • if any object in data cannot be handled by converter.
See Also:
ObjectToDataCellConverter.createDataCell(Object)

DefaultTable

public DefaultTable(int[][] data)
Deprecated. 
Calls this(data, (String[])null, (String[])null);.

Parameters:
data - Data to be set in this table. For further details see other constructor
See Also:
DefaultTable(int[][], String[], String[])

DefaultTable

public DefaultTable(double[][] data,
                    String[] rowHeader,
                    String[] colHeader)
Deprecated. 
Generates a new instance from an double[][] using the default DataCell factory. All entries in this parameter array are wrapped by an DoubleCell by calling ObjectToDataCellConverter.createDataCell(new Double(data[i][j])

Parameters:
data - Content of the table, all rows must have same length.
rowHeader - The name of the rows in an array. May be null. The length of the array (if given) must match data.length.
colHeader - The name of the columns in an array. May be null. The length of the array (if given) must match data[r].length for any given r.
Throws:
IllegalArgumentException - In the following cases:
  • data is null
  • data.length != rowHeader.length if rowHeader is given (non-null)
  • if length of colHeader (if not null) is unequal to the length of any row in data
  • if any object in data cannot be handled by converter.

DefaultTable

public DefaultTable(double[][] data)
Deprecated. 
Calls this(data, (String[])null, (String[])null);.

Parameters:
data - Data to be set in this table. For further details see other constructor
See Also:
DefaultTable(double[][], String[], String[])
Method Detail

getDataTableSpec

public DataTableSpec getDataTableSpec()
Deprecated. 
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 RowIterator iterator()
Deprecated. 
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
Returns:
row iterator
See Also:
DataRow

getRowsInList

protected final List<DataRow> getRowsInList()
Deprecated. 
Get a reference to underlying data container. The returned ArrayList contains objects of type DataRow. This method never returns null, even though the returned list can be empty if there are no rows in the table.

Returns:
reference to internal data container.

getRowCount

public int getRowCount()
Deprecated. 
Get the number of rows in this table.

Returns:
The number of rows.


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.