org.knime.core.node.defaultnodesettings
Class SettingsModelIntegerBounded

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.SettingsModelInteger
              extended by org.knime.core.node.defaultnodesettings.SettingsModelIntegerBounded
All Implemented Interfaces:
SettingsModelFlowVariableCompatible
Direct Known Subclasses:
SettingsModelOddIntegerBounded

public class SettingsModelIntegerBounded
extends SettingsModelInteger

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

Author:
ohl, University of Konstanz

Constructor Summary
SettingsModelIntegerBounded(String configName, int defaultValue, int minValue, int maxValue)
          Creates a new integer settings model with min and max value for the accepted int value.
 
Method Summary
protected  SettingsModelIntegerBounded createClone()
          
 int getLowerBound()
           
 int getUpperBound()
           
 void setIntValue(int newValue)
          set the value stored to the new value.
protected  void validateValue(int value)
          Called during SettingsModelInteger.validateSettingsForModel(org.knime.core.node.NodeSettingsRO), can be overwritten by derived classes.
 
Methods inherited from class org.knime.core.node.defaultnodesettings.SettingsModelInteger
getConfigName, getFlowVariableType, getIntValue, 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

SettingsModelIntegerBounded

public SettingsModelIntegerBounded(String configName,
                                   int defaultValue,
                                   int minValue,
                                   int maxValue)
Creates a new integer settings model with min and max value for the accepted int 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 SettingsModelIntegerBounded createClone()

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

getLowerBound

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

getUpperBound

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

validateValue

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

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

setIntValue

public void setIntValue(int newValue)
set the value stored to the new value.

Overrides:
setIntValue in class SettingsModelInteger
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.