2.17.2: 2011-06-17

net.sf.basedb.core
Class LongParameterType

java.lang.Object
  extended by net.sf.basedb.core.ParameterType<Long>
      extended by net.sf.basedb.core.LongParameterType

public class LongParameterType
extends ParameterType<Long>

This class represent a parameter type that is a long. This type defines a lower limit and an upper limit for the range of allowed values.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2010-10-01 13:51:57 +0200 (Fri, 01 Oct 2010) $

Field Summary
private  Long lowerLimit
          The lower limit of the parameter.
private  Long upperLimit
          The upper limit of the parameter.
 
Constructor Summary
LongParameterType()
          Create a new long parameter type, without any limits and allowing null values.
LongParameterType(Long lowerLimit, Long upperLimit, Long defaultValue, boolean notNull)
          Create a new long parameter type.
LongParameterType(Long lowerLimit, Long upperLimit, Long defaultValue, boolean notNull, int multiplicity, int width, int height, List<Long> items)
           
 
Method Summary
 Long getLowerLimit()
          Get the lowest valid value of the parameter.
 Long getUpperLimit()
          Get the highest valid value of the parameter.
(package private)  LongParameterValueData newParameterValueData()
          Create a new LongParameterValueData object.
 String toString()
           
(package private)  void validateValue(String name, Long 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, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lowerLimit

private final Long lowerLimit
The lower limit of the parameter.


upperLimit

private final Long upperLimit
The upper limit of the parameter.

Constructor Detail

LongParameterType

public LongParameterType()
Create a new long parameter type, without any limits and allowing null values.


LongParameterType

public LongParameterType(Long lowerLimit,
                         Long upperLimit,
                         Long defaultValue,
                         boolean notNull)
Create a new long parameter type.

Parameters:
lowerLimit - The lowest allowed value, or null to have no limit
upperLimit - The highest allowed value, or null to have no limit
defaultValue - Default value for the parameter.
notNull - FALSE if nulls values are allowed, TRUE otherwise

LongParameterType

public LongParameterType(Long lowerLimit,
                         Long upperLimit,
                         Long defaultValue,
                         boolean notNull,
                         int multiplicity,
                         int width,
                         int height,
                         List<Long> items)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

validateValue

void validateValue(String name,
                   Long 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 class ParameterType<Long>
Parameters:
value - The value to test
name - 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

LongParameterValueData newParameterValueData()
Create a new LongParameterValueData object.

Specified by:
newParameterValueData in class ParameterType<Long>

getLowerLimit

public Long getLowerLimit()
Get the lowest valid value of the parameter.

Returns:
Lowest valid value or null if none is set.

getUpperLimit

public Long getUpperLimit()
Get the highest valid value of the parameter.

Returns:
Highest valid value or null if none is set.

2.17.2: 2011-06-17