org.knime.core.node.defaultnodesettings
Class SettingsModelDoubleBounded

java.lang.Object
  extended by org.knime.core.node.defaultnodesettings.SettingsModel
      extended by org.knime.core.node.defaultnodesettings.SettingsModelNumber
          extended by org.knime.core.node.defaultnodesettings.SettingsModelDouble
              extended by org.knime.core.node.defaultnodesettings.SettingsModelDoubleBounded
All Implemented Interfaces:
SettingsModelFlowVariableCompatible

public class SettingsModelDoubleBounded
extends SettingsModelDouble

A settingsmodel for double default components accepting double between a min and max value.

Author:
ohl, University of Konstanz

Constructor Summary
SettingsModelDoubleBounded(String configName, double defaultValue, double minValue, double maxValue)
          Creates a new double settings model with min and max value for the accepted double value.
 
Method Summary
protected  SettingsModelDoubleBounded createClone()
          
 double getLowerBound()
           
 double getUpperBound()
           
 void setDoubleValue(double newValue)
          set the value stored to the new value.
protected  void validateValue(double value)
          Called during SettingsModelDouble.validateSettingsForModel(org.knime.core.node.NodeSettingsRO), can be overwritten by derived classes.
 
Methods inherited from class org.knime.core.node.defaultnodesettings.SettingsModelDouble
getConfigName, getDoubleValue, getFlowVariableType, getKey, getModelTypeID, getNumberValueStr, loadSettingsForDialog, loadSettingsForModel, saveSettingsForDialog, saveSettingsForModel, setNumberValueStr, toString, validateSettingsForModel
 
Methods inherited from class org.knime.core.node.defaultnodesettings.SettingsModel
addChangeListener, createCloneWithValidatedValue, dlgLoadSettingsFrom, dlgSaveSettingsTo, isEnabled, loadSettingsFrom, notifyChangeListeners, prependChangeListener, removeChangeListener, saveSettingsTo, setEnabled, validateSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SettingsModelDoubleBounded

public SettingsModelDoubleBounded(String configName,
                                  double defaultValue,
                                  double minValue,
                                  double maxValue)
Creates a new double settings model with min and max value for the accepted double value.

Parameters:
configName - id the value is stored with in config objects.
defaultValue - the initial value.
minValue - lower bounds of the acceptable values.
maxValue - upper bounds of the acceptable values.
Method Detail

createClone

protected SettingsModelDoubleBounded createClone()

Overrides:
createClone in class SettingsModelDouble
Returns:
a new instance of the same object with identical state and value(s).

getLowerBound

public double getLowerBound()
Returns:
the lower bound of the acceptable values.

getUpperBound

public double getUpperBound()
Returns:
the upper bound of the acceptable values.

validateValue

protected void validateValue(double value)
                      throws InvalidSettingsException
Called during SettingsModelDouble.validateSettingsForModel(org.knime.core.node.NodeSettingsRO), can be overwritten by derived classes.

Overrides:
validateValue in class SettingsModelDouble
Parameters:
value - the value to validate
Throws:
InvalidSettingsException - if the value is not valid and should be rejected

setDoubleValue

public void setDoubleValue(double newValue)
set the value stored to the new value.

Overrides:
setDoubleValue in class SettingsModelDouble
Parameters:
newValue - the new value to store.


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.