Package net.sf.basedb.core
Class DoubleParameterType
This class represent a parameter type that is a double.
This type defines a
lower limit
and an upper limit
for the range of
allowed values.- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new double parameter type, without any limits and allowing null values.DoubleParameterType
(Double lowerLimit, Double upperLimit, Double defaultValue, boolean notNull) Create a new double parameter type.DoubleParameterType
(Double lowerLimit, Double upperLimit, Double defaultValue, boolean notNull, int multiplicity, int width, int height, List<Double> items) Create a new double parameter type with a list of allowed values. -
Method Summary
Modifier and TypeMethodDescriptionGet the lowst valid value of the parameter.Get the highest valid value of the parameter.(package private) DoubleParameterValueData
Create a newDoubleParameterValueData
object.toString()
(package private) void
validateValue
(String name, Double value) Checks if the value is within the range given by the upper and lower limits if those are given.Methods inherited from class net.sf.basedb.core.ParameterType
getDefaultValue, getEnumeration, getHeight, getItems, getMultiplicity, getNotNull, getParameterClass, getValueType, getWidth, isEnumeration, isMasked, validate, validate
-
Field Details
-
lowerLimit
The lower limit of the parameter. -
upperLimit
The upper limit of the parameter.
-
-
Constructor Details
-
DoubleParameterType
public DoubleParameterType()Create a new double parameter type, without any limits and allowing null values. -
DoubleParameterType
public DoubleParameterType(Double lowerLimit, Double upperLimit, Double defaultValue, boolean notNull) Create a new double parameter type.- Parameters:
lowerLimit
- The lowest allowed value, or null to have no limitupperLimit
- The highest allowed value, or null to have no limitdefaultValue
- Default value for the parameter, or null.notNull
- FALSE if nulls values are allowed, TRUE otherwise
-
DoubleParameterType
public DoubleParameterType(Double lowerLimit, Double upperLimit, Double defaultValue, boolean notNull, int multiplicity, int width, int height, List<Double> items) Create a new double parameter type with a list of allowed values.- Parameters:
lowerLimit
- The lowest allowed value, or null to have no limit.upperLimit
- The highest allowed value, or null to have no limit.defaultValue
- The default value of the parameter.notNull
- FALSE if nulls values are allowed, TRUE otherwisemultiplicity
- Number of values that can be tied to this parameter, or null to have no limit.width
- Width of the input field for the parameter in the GUI.height
- Heigth of the input field for the parameter in the GUI.items
- List of allowed values..
-
-
Method Details
-
toString
-
validateValue
Checks if the value is within the range given by the upper and lower limits if those are given.- Specified by:
validateValue
in classParameterType<Double>
- Parameters:
value
- The value to testname
- The name of the parameter, use the name if there is need to throw an exception- Throws:
InvalidDataException
- If the value is outside the range of allowed values
-
newParameterValueData
DoubleParameterValueData newParameterValueData()Create a newDoubleParameterValueData
object.- Specified by:
newParameterValueData
in classParameterType<Double>
-
getLowerLimit
Get the lowst valid value of the parameter.- Returns:
- Lowst valid value or null if none is set.
-
getUpperLimit
Get the highest valid value of the parameter.- Returns:
- Highest valid value or null if none is set.
-