javax.rad.type
Class AbstractNumberType<T extends Number & Comparable<T>>

java.lang.Object
  extended by javax.rad.type.AbstractType<T>
      extended by javax.rad.type.AbstractComparableType<T>
          extended by javax.rad.type.AbstractNumberType<T>
Type Parameters:
T - the Number type.
All Implemented Interfaces:
IType<T>
Direct Known Subclasses:
DecimalType, DoubleType, FloatType, IntegerType, LongType

public abstract class AbstractNumberType<T extends Number & Comparable<T>>
extends AbstractComparableType<T>

The AbstractNumberType is the base implementation for all numeric types.


Field Summary
protected  T maxValue
          The maximal allowed value.
protected  T minValue
          The minimal allowed value.
protected  int precision
          The precision.
 
Fields inherited from interface javax.rad.type.IType
UNKNOWN_TYPE
 
Constructor Summary
AbstractNumberType()
           
 
Method Summary
 T getMaxValue()
          Gets the maximal allowed value.
 T getMinValue()
          Gets the minimal allowed value.
 int getPrecision()
          Gets the precision.
 void setMaxValue(T pMaxValue)
          Sets the maximal allowed value.
 void setMinValue(T pMinValue)
          Sets the minimal allowed value.
 void setPrecision(int pPrecision)
          Sets the precision.
 T validatedValueOf(Object pObject)
          Converts the object to an Object which is an instance of type class.
 
Methods inherited from class javax.rad.type.AbstractComparableType
compareTo
 
Methods inherited from class javax.rad.type.AbstractType
equals, getTypeFromClass, getTypeFromObject, hashCode, registerType, toString, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.rad.type.IType
getTypeClass
 

Field Detail

minValue

protected T extends Number & Comparable<T> minValue
The minimal allowed value.


maxValue

protected T extends Number & Comparable<T> maxValue
The maximal allowed value.


precision

protected int precision
The precision.

Constructor Detail

AbstractNumberType

public AbstractNumberType()
Method Detail

validatedValueOf

public T validatedValueOf(Object pObject)
Converts the object to an Object which is an instance of type class.

Specified by:
validatedValueOf in interface IType<T extends Number & Comparable<T>>
Overrides:
validatedValueOf in class AbstractType<T extends Number & Comparable<T>>
Parameters:
pObject - the Object to convert
Returns:
the Object which is an instance of type class.

getMinValue

public T getMinValue()
Gets the minimal allowed value.

Returns:
the minimal allowed value.

setMinValue

public void setMinValue(T pMinValue)
Sets the minimal allowed value.

Parameters:
pMinValue - the minimal allowed value.

getMaxValue

public T getMaxValue()
Gets the maximal allowed value.

Returns:
the maximal allowed value.

setMaxValue

public void setMaxValue(T pMaxValue)
Sets the maximal allowed value.

Parameters:
pMaxValue - the maximal allowed value.

getPrecision

public int getPrecision()
Gets the precision.

Returns:
the precision.

setPrecision

public void setPrecision(int pPrecision)
Sets the precision.

Parameters:
pPrecision - the precision.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.