org.knime.core.data.container
Class SingleCellFactory

java.lang.Object
  extended by org.knime.core.data.container.AbstractCellFactory
      extended by org.knime.core.data.container.SingleCellFactory
All Implemented Interfaces:
CellFactory
Direct Known Subclasses:
BitVectorCellFactory

public abstract class SingleCellFactory
extends AbstractCellFactory

Convenience implementation of a cell factory with one new column.

As of v2.5 the input table can be processed concurrently. This property should only be set if (i) the processing of an individual row is expensive, i.e. takes significantly longer than pure I/O and (ii) there are no interdependency between the row calculations.

Author:
Bernd Wiswedel, University of Konstanz

Constructor Summary
SingleCellFactory(boolean processConcurrently, DataColumnSpec newColSpec)
          Create new cell factory that provides one column given by newColSpec.
SingleCellFactory(boolean processConcurrently, int workerCount, int maxQueueSize, DataColumnSpec newColSpec)
          Create new cell factory that provides one column given by newColSpec.
SingleCellFactory(DataColumnSpec newColSpec)
          Create new cell factory that provides one column given by newColSpec.
 
Method Summary
abstract  DataCell getCell(DataRow row)
          Called from getCells.
 DataCell[] getCells(DataRow row)
          Get the new cells for a given row.
 
Methods inherited from class org.knime.core.data.container.AbstractCellFactory
getColumnSpecs, getMaxParallelWorkers, getMaxQueueSize, isParallelProcessing, setParallelProcessing, setParallelProcessing, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleCellFactory

public SingleCellFactory(DataColumnSpec newColSpec)
Create new cell factory that provides one column given by newColSpec. The calculation is done sequentially (no parallel processing of input).

Parameters:
newColSpec - The spec of the new column.

SingleCellFactory

public SingleCellFactory(boolean processConcurrently,
                         DataColumnSpec newColSpec)
Create new cell factory that provides one column given by newColSpec.

Parameters:
processConcurrently - If to process the rows concurrently (must only be true if there are no interdependency between the rows).
newColSpec - The spec of the new column.
Since:
2.5
See Also:
AbstractCellFactory.setParallelProcessing(boolean)

SingleCellFactory

public SingleCellFactory(boolean processConcurrently,
                         int workerCount,
                         int maxQueueSize,
                         DataColumnSpec newColSpec)
Create new cell factory that provides one column given by newColSpec.

Parameters:
processConcurrently - If to process the rows concurrently (must only be true if there are no interdependency between the rows).
workerCount - see AbstractCellFactory.setParallelProcessing(boolean, int, int)
maxQueueSize - see AbstractCellFactory.setParallelProcessing(boolean, int, int)
newColSpec - The spec of the new column.
Since:
2.5
See Also:
AbstractCellFactory.setParallelProcessing(boolean, int, int)
Method Detail

getCells

public DataCell[] getCells(DataRow row)
Get the new cells for a given row. These cells are incorporated into the existing row. The way it is done is defined through the ColumnRearranger using this object.

Parameters:
row - The row of interest.
Returns:
The new cells to that row.

getCell

public abstract DataCell getCell(DataRow row)
Called from getCells. Return the single cell to be returned.

Parameters:
row - The reference row.
Returns:
The new cell.


Copyright, 2003 - 2012. 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.