org.knime.base.node.io.filereader
Class ColProperty

java.lang.Object
  extended by org.knime.base.node.io.filereader.ColProperty

public class ColProperty
extends Object

Stores the properties for one column.

Author:
Peter Ohl, University of Konstanz

Constructor Summary
ColProperty()
          Creates an empty column properties object.
ColProperty(NodeSettingsRO cfg)
          Creates a new column properties object initializing its settings from the passed configuration object.
 
Method Summary
 void changeColumnName(String colName)
          Sets a new column name for this column.
 void changeColumnType(DataType newType)
          Sets a new column type for this column.
 void changeDomain(DataColumnDomain newDomain)
          Replaces the list of possible values for this columns.
 Object clone()
          Returns a new ColProperty object containing a deep copy of this one.
 DataColumnSpec getColumnSpec()
           
 String getMissingValuePattern()
           
 boolean getReadPossibleValuesFromFile()
           
 boolean getSkipThisColumn()
           
 boolean getUserSettings()
           
 void saveToConfiguration(NodeSettingsWO cfg)
          Writes all settings from this object into the passed configuration object.
 void setColumnSpec(DataColumnSpec cSpec)
           
 void setMissingValuePattern(String missValue)
           
 void setReadPossibleValuesFromFile(boolean readThem)
          Determines if the possible values of this column will be read from file (used only with integer columns).
 void setSkipThisColumn(boolean skipIt)
           
 void setUserSettings(boolean setByUser)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColProperty

public ColProperty()
Creates an empty column properties object.


ColProperty

public ColProperty(NodeSettingsRO cfg)
            throws InvalidSettingsException
Creates a new column properties object initializing its settings from the passed configuration object.

Parameters:
cfg - a config object to read the internal settings from
Throws:
InvalidSettingsException - if the config object did not contain the expected settings
Method Detail

saveToConfiguration

public void saveToConfiguration(NodeSettingsWO cfg)
Writes all settings from this object into the passed configuration object.

Parameters:
cfg - the configuration object to write the settings into

setColumnSpec

public void setColumnSpec(DataColumnSpec cSpec)
Parameters:
cSpec - the column spec to store in this property object

getColumnSpec

public DataColumnSpec getColumnSpec()
Returns:
the column spec containing most properties of this column

getMissingValuePattern

public String getMissingValuePattern()
Returns:
the pattern that indicates missing data in this column

setMissingValuePattern

public void setMissingValuePattern(String missValue)
Parameters:
missValue - the missing value pattern to store

getUserSettings

public boolean getUserSettings()
Returns:
true if settings in this property object are set by the user, false if all settings are default/guessed values.

setUserSettings

public void setUserSettings(boolean setByUser)
Parameters:
setByUser - flag indicating that the values in this object are settings specified by the user - as opposed to default/guessed settings.

getReadPossibleValuesFromFile

public boolean getReadPossibleValuesFromFile()
Returns:
true if the possible values should be read from file. This is set only for integer columns.

setReadPossibleValuesFromFile

public void setReadPossibleValuesFromFile(boolean readThem)
Determines if the possible values of this column will be read from file (used only with integer columns).

Parameters:
readThem - the new value of the flag. true if possible values should be read, false otherwise.

getSkipThisColumn

public boolean getSkipThisColumn()
Returns:
true if this column is not included in the reader's table.

setSkipThisColumn

public void setSkipThisColumn(boolean skipIt)
Parameters:
skipIt - specify true, if this column should not be included in the reader's file table. Set to false (the default), if the column should appear in the file reader's output table.

changeColumnName

public void changeColumnName(String colName)
Sets a new column name for this column.

Parameters:
colName - the new name

changeColumnType

public void changeColumnType(DataType newType)
Sets a new column type for this column.

Parameters:
newType - the new type

changeDomain

public void changeDomain(DataColumnDomain newDomain)
Replaces the list of possible values for this columns.

Parameters:
newDomain - the new domain to set in the column spec of this col property

toString

public String toString()

Overrides:
toString in class Object

clone

public Object clone()
Returns a new ColProperty object containing a deep copy of this one.

Overrides:
clone in class Object


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.