Class MathType
- 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.MathType
-
- All Implemented Interfaces:
NumberType
public class MathType extends ClassType implements NumberType
This class represents the types java.math.BigDecimal and java.math.BigInteger.- Version:
- 0.1
- Author:
- Michael Bouschen
-
-
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.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
-
-
-
-
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 BigDecimal, if this represents the type BigDecimal.- 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
-
-