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

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

public class ResortedCellsRow
extends Object
implements DataRow

A row that takes a base row and re-sorts the cells in it according to an int[] parameter passed in the constructor.

Author:
Bernd Wiswedel, University of Konstanz

Constructor Summary
protected ResortedCellsRow(DataRow row, int[] sort)
          Creates new row with row as underlying base row and sort the new sorting scheme.
 
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

ResortedCellsRow

protected ResortedCellsRow(DataRow row,
                           int[] sort)
Creates new row with row as underlying base row and sort the new sorting scheme. That is the old i-th entry becomes entry number sort[i].

Parameters:
row - the base row
sort - the re-sorting
Throws:
IllegalArgumentException - if the lengths of arrays don't match
NullPointerException - if either argument is null
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.