org.knime.base.data.util
Class DataCellStringMapper

java.lang.Object
  extended by org.knime.base.data.util.DataCellStringMapper

public final class DataCellStringMapper
extends Object

Allow a mapping of arbitrary DataCells to unique, well-behaved strings, for example for usage with external executables that may frown upon parsing arbitrary strings. Keeps two maps for each direction (DataCell <-> String) and creates new, unique Strings for unknown DataCells.

Author:
Michael Berthold, University of Konstanz, Nicolas Cebron, University of Konstanz

Constructor Summary
DataCellStringMapper()
          Public constructor.
 
Method Summary
 String dataCellToString(DataCell cell)
           
static DataCellStringMapper load(ConfigRO config)
          Reads a DataCellStringMapper from given ConfigRO.
 String origStringToString(String origString)
           
 void save(ConfigWO config)
          Saves the DataCellStringMapper> to the given ConfigWO.
 DataCell stringToDataCell(String str)
           
 String stringToOrigString(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataCellStringMapper

public DataCellStringMapper()
Public constructor.

Method Detail

dataCellToString

public String dataCellToString(DataCell cell)
Parameters:
cell - DataCell to be replaced
Returns:
unique string representation

origStringToString

public String origStringToString(String origString)
Parameters:
origString - the original 'ugly' string
Returns:
unique string representation

stringToDataCell

public DataCell stringToDataCell(String str)
Parameters:
str - string representation
Returns:
DataCell represented by the string

stringToOrigString

public String stringToOrigString(String str)
Parameters:
str - string representation
Returns:
string original string

save

public void save(ConfigWO config)
Saves the DataCellStringMapper> to the given ConfigWO.

Parameters:
config - Save settings to.

load

public static DataCellStringMapper load(ConfigRO config)
                                 throws InvalidSettingsException
Reads a DataCellStringMapper from given ConfigRO.

Parameters:
config - to read the mapper from
Returns:
A new DataCellStringMapper object.
Throws:
InvalidSettingsException - If the settings could not be read.


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.