Package net.sf.basedb.core
Class FloatParameterType
- java.lang.Object
-
- net.sf.basedb.core.ParameterType<Float>
-
- net.sf.basedb.core.FloatParameterType
-
public class FloatParameterType extends ParameterType<Float>
This class represent a parameter type that is a float. This type defines alower limit
and anupper limit
for the range of allowed values.- Version:
- 2.0
- Author:
- Samuel, Nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
-
Field Summary
Fields Modifier and Type Field Description private Float
lowerLimit
The lower limit of the parameter.private Float
upperLimit
The upper limit of the parameter.
-
Constructor Summary
Constructors Constructor Description FloatParameterType()
Create a new float parameter type, without any limits and allowing null values.FloatParameterType(Float lowerLimit, Float upperLimit, Float defaultValue, boolean notNull)
Create a new float parameter type.FloatParameterType(Float lowerLimit, Float upperLimit, Float defaultValue, boolean notNull, int multiplicity, int width, int height, List<Float> items)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Float
getLowerLimit()
Get the lowst valid value of the parameter.Float
getUpperLimit()
Get the highest valid value of the parameter.(package private) FloatParameterValueData
newParameterValueData()
Create a newFloatParameterValueData
object.String
toString()
(package private) void
validateValue(String name, Float 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
-
-
-
-
Constructor Detail
-
FloatParameterType
public FloatParameterType()
Create a new float parameter type, without any limits and allowing null values.
-
FloatParameterType
public FloatParameterType(Float lowerLimit, Float upperLimit, Float defaultValue, boolean notNull)
Create a new float parameter type.- Parameters:
lowerLimit
- The lowest allowed value, or null to have no limitupperLimit
- The highest allowed value, or null to have no limitdefaultValue
- A value to use by default with the parameter.notNull
- FALSE if nulls values are allowed, TRUE otherwise
-
-
Method Detail
-
validateValue
void validateValue(String name, Float value) throws InvalidDataException
Checks if the value is within the range given by the upper and lower limits if those are given.- Specified by:
validateValue
in classParameterType<Float>
- 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
FloatParameterValueData newParameterValueData()
Create a newFloatParameterValueData
object.- Specified by:
newParameterValueData
in classParameterType<Float>
-
getLowerLimit
public Float getLowerLimit()
Get the lowst valid value of the parameter.- Returns:
- Lowst valid value or null if none is set.
-
getUpperLimit
public Float getUpperLimit()
Get the highest valid value of the parameter.- Returns:
- Highest valid value or null if none is set.
-
-