org.knime.core.data.container
Class BlobSupportDataRow

java.lang.Object
  extended by org.knime.core.data.container.BlobSupportDataRow
All Implemented Interfaces:
Iterable<DataCell>, DataRow

public final class BlobSupportDataRow
extends Object
implements DataRow

Special row implementation that supports to access the wrapper cells of BlobDataCell. Dealing with the wrapper cells (BlobWrapperDataCell) gives the benefit that blobs are not read from the file when passed from one place to another (they will be read on access).

Author:
Bernd Wiswedel, University of Konstanz

Constructor Summary
BlobSupportDataRow(RowKey key, DataCell[] cells)
           
BlobSupportDataRow(RowKey key, DataRow oldRow)
          Creates a new data row with a new row ID.
BlobSupportDataRow(String id, DataRow oldRow)
          Creates a new data row with a new row ID.
 
Method Summary
 DataCell getCell(int index)
          If the cell at index is a blob wrapper cell, it will fetch the content and return it.
 RowKey getKey()
          Returns the row key.
 int getNumCells()
          Returns the length of this row, that is the number of columns of the DataTable (not including the row key).
 DataCell getRawCell(int index)
          Returns the cell at given index.
 Iterator<DataCell> iterator()
          
 String toString()
          Get a string representing this row, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlobSupportDataRow

public BlobSupportDataRow(RowKey key,
                          DataCell[] cells)
Parameters:
key - Row key
cells - cell array.

BlobSupportDataRow

public BlobSupportDataRow(RowKey key,
                          DataRow oldRow)
Creates a new data row with a new row ID.

Parameters:
key - the key with the new row ID
oldRow - container of the cells for the new row

BlobSupportDataRow

public BlobSupportDataRow(String id,
                          DataRow oldRow)
Creates a new data row with a new row ID.

Parameters:
id - the new row ID
oldRow - container of the cells for the new row
Method Detail

getCell

public DataCell getCell(int index)
If the cell at index is a blob wrapper cell, it will fetch the content and return it. Returns the DataCell at the provided index within this row.

Specified by:
getCell in interface DataRow
Parameters:
index - the index of the cell to retrieve (indices start from 0)
Returns:
the DataCell at the given index

getRawCell

public DataCell getRawCell(int index)
Returns the cell at given index. Returns the wrapper cell (if any).

Parameters:
index - Cell index.
Returns:
Raw cell.

getKey

public RowKey getKey()
Returns the row key.

Specified by:
getKey in interface DataRow
Returns:
the row key

getNumCells

public int getNumCells()
Returns the length of this row, that is the number of columns of the DataTable (not including the row key).

Specified by:
getNumCells in interface DataRow
Returns:
length of this row

iterator

public Iterator<DataCell> iterator()

Specified by:
iterator in interface Iterable<DataCell>

toString

public String toString()
Get a string representing this row, i.e. "rowkey: (cell1, ..., celln)"

Overrides:
toString in class Object
Returns:
key + values of this row in a string


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.