org.knime.base.data.bitvector
Class IdString2BitVectorCellFactory

java.lang.Object
  extended by org.knime.core.data.container.AbstractCellFactory
      extended by org.knime.core.data.container.SingleCellFactory
          extended by org.knime.base.data.bitvector.BitVectorCellFactory
              extended by org.knime.base.data.bitvector.BitVectorColumnCellFactory
                  extended by org.knime.base.data.bitvector.IdString2BitVectorCellFactory
All Implemented Interfaces:
CellFactory

public class IdString2BitVectorCellFactory
extends BitVectorColumnCellFactory

Author:
Fabian Dill, University of Konstanz

Constructor Summary
IdString2BitVectorCellFactory(DataColumnSpec colSpec, int columnIndex)
          Create new cell factory that provides one column given by newColSpec.
 
Method Summary
 DataCell getCell(DataRow row)
          Called from getCells.
 int getNumberOfNotSetBits()
           
 int getNumberOfSetBits()
           
 void setMaxPos(int maxPos)
           
 boolean wasSuccessful()
          
 
Methods inherited from class org.knime.base.data.bitvector.BitVectorColumnCellFactory
getColumnIndex, printError
 
Methods inherited from class org.knime.base.data.bitvector.BitVectorCellFactory
getNrOfProcessedRows, incrementNrOfRows
 
Methods inherited from class org.knime.core.data.container.SingleCellFactory
getCells
 
Methods inherited from class org.knime.core.data.container.AbstractCellFactory
getColumnSpecs, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdString2BitVectorCellFactory

public IdString2BitVectorCellFactory(DataColumnSpec colSpec,
                                     int columnIndex)
Create new cell factory that provides one column given by newColSpec.

Parameters:
colSpec - the spec of the new column
columnIndex - index of the column to be replaced
Method Detail

setMaxPos

public void setMaxPos(int maxPos)
Parameters:
maxPos - the actual length of the bit set - the max position

getCell

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

Specified by:
getCell in class SingleCellFactory
Parameters:
row - The reference row.
Returns:
The new cell.

wasSuccessful

public boolean wasSuccessful()

Specified by:
wasSuccessful in class BitVectorCellFactory
Returns:
true if at least one conversion was successful, false otherwise.

getNumberOfSetBits

public int getNumberOfSetBits()
Specified by:
getNumberOfSetBits in class BitVectorCellFactory
Returns:
the number of set bits.

getNumberOfNotSetBits

public int getNumberOfNotSetBits()
Specified by:
getNumberOfNotSetBits in class BitVectorCellFactory
Returns:
the number of not set bits.


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.