org.knime.base.data.append.column
Class DefaultAppendedCellFactory

java.lang.Object
  extended by org.knime.base.data.append.column.DefaultAppendedCellFactory
All Implemented Interfaces:
AppendedCellFactory

public class DefaultAppendedCellFactory
extends Object
implements AppendedCellFactory

A default factory that generates cells based on an underlying Map. This default implementation only allows extension by one column.

Author:
Bernd Wiswedel, University of Konstanz

Constructor Summary
DefaultAppendedCellFactory(Map<RowKey,DataCell> map)
          Creates new factory.
 
Method Summary
 DataCell[] getAppendedCell(DataRow row)
          Get the value to row's key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAppendedCellFactory

public DefaultAppendedCellFactory(Map<RowKey,DataCell> map)
Creates new factory. The mapping is based on the argument. It has to map the row key to the new (to be appended) cell.

If the map does not contain requested keys the factory method will throw an NoSuchElementException. Thus, make sure you provide a complete list.

Parameters:
map - mapping DataCell --> DataCell
Throws:
NullPointerException - if the map is null
Method Detail

getAppendedCell

public DataCell[] getAppendedCell(DataRow row)
Get the value to row's key.

Specified by:
getAppendedCell in interface AppendedCellFactory
Parameters:
row - where to get the key from
Returns:
the cell from the underlying map
Throws:
NullPointerException - if the argument is null
IllegalArgumentException - if the key is not contained in the map or the value to the key is not instance of DataCell
See Also:
AppendedCellFactory.getAppendedCell(DataRow)


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.