Class NumericType
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.Type
-
- com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.PrimitiveType
-
- com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.NumericType
-
- All Implemented Interfaces:
NumberType
- Direct Known Subclasses:
FloatingPointType
,IntegralType
public abstract class NumericType extends PrimitiveType implements NumberType
This class is the super class for all integral and floating point types.- Version:
- 0.1
- Author:
- Michael Bouschen
-
-
Constructor Summary
Constructors Constructor Description NumericType(String name, Class clazz, int enumType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Number
getValue(Number value)
Converts the specified value into a value of this numeric type.boolean
isOrderable()
A numeric type defines an ordering.abstract Number
negate(Number value)
Returns -value.-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.PrimitiveType
getWrapper, isCompatibleWith, setWrapper
-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.Type
equals, getEnumType, getJavaClass, getName, toString
-
-
-
-
Method Detail
-
isOrderable
public boolean isOrderable()
A numeric type defines an ordering.- Overrides:
isOrderable
in classType
- Returns:
- true if an order is defined for this; false otherwise.
-
getValue
public abstract Number getValue(Number value)
Converts the specified value into a value of this numeric type. E.g. an Integer is converted into a Double, if this represents the numeric type double.- Specified by:
getValue
in interfaceNumberType
- Parameters:
value
- value to be converted- Returns:
- converted value
-
negate
public abstract Number negate(Number value)
Returns -value.- Specified by:
negate
in interfaceNumberType
- Parameters:
value
- value to be negated- Returns:
- -value
-
-