Class NumericWrapperClassType
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.Type
-
- com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.ClassType
-
- com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.WrapperClassType
-
- com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.NumericWrapperClassType
-
- All Implemented Interfaces:
NumberType
public class NumericWrapperClassType extends WrapperClassType implements NumberType
- Version:
- 0.1
- Author:
- Michael Bouschen
-
-
Field Summary
-
Fields inherited from class com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.WrapperClassType
primitiveType
-
Fields inherited from class com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.ClassType
fieldInfos, pce, typetab
-
-
Constructor Summary
Constructors Constructor Description NumericWrapperClassType(String name, Class clazz, int enumType, PrimitiveType primitiveType, TypeTable typetab)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Number
getValue(Number value)
Converts the specified value into a value of this numeric type.boolean
isOrderable()
A numeric wrapper class type defines an ordering.Number
negate(Number value)
Returns -value.-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.WrapperClassType
getPrimitiveType
-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.ClassType
getFieldInfo, getFieldInfos, getKeyFieldNames, isCompatibleWith, isPersistenceCapable
-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.Type
equals, getEnumType, getJavaClass, getName, toString
-
-
-
-
Constructor Detail
-
NumericWrapperClassType
public NumericWrapperClassType(String name, Class clazz, int enumType, PrimitiveType primitiveType, TypeTable typetab)
-
-
Method Detail
-
isOrderable
public boolean isOrderable()
A numeric wrapper class type defines an ordering.- Overrides:
isOrderable
in classClassType
- Returns:
- true if an order is defined for this; false otherwise.
-
getValue
public 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 Number negate(Number value)
Returns -value.- Specified by:
negate
in interfaceNumberType
- Parameters:
value
- value to be negated- Returns:
- -value
-
-