org.knime.base.data.replace
Class ReplacedColumnsDataRow

java.lang.Object
  extended by org.knime.base.data.replace.ReplacedColumnsDataRow
All Implemented Interfaces:
Iterable<DataCell>, DataRow

public class ReplacedColumnsDataRow
extends Object
implements DataRow

Author:
Bernd Wiswedel, University of Konstanz

Constructor Summary
ReplacedColumnsDataRow(DataRow row, DataCell[] newCells, int[] columns)
          Creates a new replaced column row.
ReplacedColumnsDataRow(DataRow row, DataCell newCell, int column)
          Convenience constructor that replaces one cell only.
 
Method Summary
 DataCell getCell(int index)
          Returns the DataCell at the provided index within this row.
 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).
 Iterator<DataCell> iterator()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplacedColumnsDataRow

public ReplacedColumnsDataRow(DataRow row,
                              DataCell[] newCells,
                              int[] columns)
Creates a new replaced column row.

Parameters:
row - the row to replace one or more columns in
newCells - the new cells
columns - at positions
Throws:
IndexOutOfBoundsException - if one of the column indices is not inside the row
NullPointerException - if the replace cell is null

ReplacedColumnsDataRow

public ReplacedColumnsDataRow(DataRow row,
                              DataCell newCell,
                              int column)
Convenience constructor that replaces one cell only. This constructor calls:
 this(row, new DataCell[]{newCell}, new int[]{column});
 
.

Parameters:
row - the row to replace one column in
newCell - the new cell
column - the column to be replaced
Method Detail

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

getKey

public RowKey getKey()
Returns the row key.

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

getCell

public DataCell getCell(int index)
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

iterator

public Iterator<DataCell> iterator()

Specified by:
iterator in interface Iterable<DataCell>


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.