|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.types.DataType
org.apache.derby.iapi.types.NumberDataType
NumberDataType is the superclass for all exact and approximate numeric data types. It exists for the purpose of allowing classification of types for supported implicit conversions among them.
DataType
,
Serialized FormField Summary |
Fields inherited from interface org.apache.derby.iapi.types.NumberDataValue |
MAX_DECIMAL_PRECISION_SCALE, MIN_DECIMAL_DIVIDE_SCALE |
Fields inherited from interface org.apache.derby.iapi.types.Orderable |
ORDER_OP_EQUALS, ORDER_OP_GREATEROREQUALS, ORDER_OP_GREATERTHAN, ORDER_OP_LESSOREQUALS, ORDER_OP_LESSTHAN |
Constructor Summary | |
NumberDataType()
|
Method Summary | |
NumberDataValue |
absolute(NumberDataValue result)
Numbers check for isNegative first and negate it if negative. |
int |
compare(DataValueDescriptor arg)
Compare this Orderable with a given Orderable for the purpose of index positioning. |
boolean |
compare(int op,
DataValueDescriptor other,
boolean orderedNulls,
boolean unknownRV)
Compare this Orderable with a given Orderable for the purpose of qualification and sorting. |
NumberDataValue |
divide(NumberDataValue dividend,
NumberDataValue divisor,
NumberDataValue result,
int scale)
This is dummy parent divide method. |
protected abstract boolean |
isNegative()
The isNegative abstract method. |
NumberDataValue |
mod(NumberDataValue dividend,
NumberDataValue divisor,
NumberDataValue result)
The SQL mod operator. |
static double |
normalizeDOUBLE(double v)
normalizeDOUBLE checks the validity of the given java double that it fits within the range of DB2 DOUBLEs. |
static float |
normalizeREAL(double v)
normalizeREAL checks the validity of the given java double that it fits within the range of DB2 REALs. |
static float |
normalizeREAL(float v)
normalizeREAL checks the validity of the given java float that it fits within the range of DB2 REALs. |
protected boolean |
objectNull(java.lang.Object o)
|
void |
setValue(java.math.BigDecimal theValue)
setValue for integral exact numerics. |
void |
setValue(java.lang.Boolean theValue)
Set the value. |
void |
setValue(java.lang.Byte theValue)
Set the value of this NumberDataValue to the given byte value |
void |
setValue(java.lang.Double theValue)
Set the value of this NumberDataValue to the given double value |
void |
setValue(java.lang.Float theValue)
Set the value of this NumberDataValue to the given float value |
void |
setValue(java.lang.Integer theValue)
Set the value of this NumberDataValue to the given int value |
void |
setValue(java.lang.Long theValue)
Set the value of this NumberDataValue to the given long value |
void |
setValue(java.lang.Short theValue)
Set the value of this NumberDataValue to the given short value |
NumberDataValue |
sqrt(NumberDataValue result)
This is the sqrt method. |
protected abstract int |
typeCompare(DataValueDescriptor arg)
Compare this (not null) to a non-null value. |
Methods inherited from class org.apache.derby.iapi.types.DataType |
checkHostVariable, cloneObject, coalesce, dataTypeConversion, equals, equals, flip, genericSetObject, getBigDecimal, getBoolean, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLong, getNationalString, getObject, getShort, getStream, getTime, getTimestamp, greaterOrEquals, greaterThan, in, invalidFormat, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, notEquals, outOfRange, setFrom, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, throwLangSetMismatch, throwLangSetMismatch, typePrecedence |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.types.NumberDataValue |
divide, minus, minus, plus, times |
Methods inherited from interface org.apache.derby.iapi.types.DataValueDescriptor |
checkHostVariable, coalesce, equals, estimateMemoryUsage, getBigDecimal, getBoolean, getByte, getBytes, getClone, getDate, getDouble, getFloat, getInt, getLength, getLong, getNewNull, getObject, getShort, getStream, getString, getTime, getTimestamp, getTypeName, greaterOrEquals, greaterThan, in, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, notEquals, readExternalFromArray, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFromResultSet, typePrecedence |
Methods inherited from interface org.apache.derby.iapi.services.io.Storable |
isNull, restoreToNull |
Methods inherited from interface java.io.Externalizable |
readExternal, writeExternal |
Methods inherited from interface org.apache.derby.iapi.services.io.TypedFormat |
getTypeFormatId |
Constructor Detail |
public NumberDataType()
Method Detail |
public NumberDataValue absolute(NumberDataValue result) throws StandardException
absolute
in interface NumberDataValue
result
- The result of the previous call to this method, null
if not called yet.
StandardException
- thrown on error.public NumberDataValue sqrt(NumberDataValue result) throws StandardException
sqrt
in interface NumberDataValue
result
- The result of the previous call to this method, null
if not call yet.
StandardException
- thrown on a negative number.public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale) throws StandardException
divide
in interface NumberDataValue
dividend
- The numeratordivisor
- The denominatorresult
- The result of the previous call to this method, null
if not called yet.scale
- The scale of the result, for decimal type. If pass
in value < 0, can calculate it dynamically.
StandardException
- Thrown on error, if result is non-null then its value will be unchanged.public NumberDataValue mod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException
NumberDataValue
mod
in interface NumberDataValue
dividend
- The numeratordivisor
- The denominatorresult
- The result of the previous call to this method, null
if not called yet.
StandardException
- Thrown on error, if result is non-null then its value will be unchanged.public final int compare(DataValueDescriptor arg) throws StandardException
DataValueDescriptor
compare
in interface DataValueDescriptor
arg
- The Orderable to compare this one to.
StandardException
- Thrown on errorprotected abstract int typeCompare(DataValueDescriptor arg) throws StandardException
StandardException
- Thrown on errorpublic final boolean compare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException
DataValueDescriptor
compare
in interface DataValueDescriptor
compare
in class DataType
StandardException
- thrown on errorprotected abstract boolean isNegative()
public final void setValue(java.lang.Byte theValue) throws StandardException
NumberDataValue
setValue
in interface NumberDataValue
theValue
- A Byte containing the value to set this
NumberDataValue to. Null means set the value
to SQL null.
StandardException
NumberDataValue.setValue(java.lang.Integer)
public final void setValue(java.lang.Short theValue) throws StandardException
NumberDataValue
setValue
in interface NumberDataValue
theValue
- A Short containing the value to set this
NumberDataValue to. Null means set the value
to SQL null.
StandardException
- Thrown on errorNumberDataValue.setValue(java.lang.Integer)
public final void setValue(java.lang.Integer theValue) throws StandardException
NumberDataValue
setValue
in interface NumberDataValue
theValue
- An Integer containing the value to set this
NumberDataValue to. Null means set the value
to SQL null.
StandardException
- Thrown on errorNumberDataValue.setValue(java.lang.Integer)
public final void setValue(java.lang.Long theValue) throws StandardException
NumberDataValue
setValue
in interface NumberDataValue
theValue
- A Long containing the value to set this
NumberDataValue to. Null means set the value
to SQL null.
StandardException
- Thrown on errorNumberDataValue.setValue(java.lang.Integer)
public final void setValue(java.lang.Double theValue) throws StandardException
NumberDataValue
setValue
in interface NumberDataValue
theValue
- A Double containing the value to set this
NumberDataValue to. Null means set the value
to SQL null.
StandardException
- Thrown on errorNumberDataValue.setValue(java.lang.Integer)
public void setValue(java.math.BigDecimal theValue) throws StandardException
setValue
in interface DataValueDescriptor
setValue
in class DataType
theValue
- The BigDecimal value to set this DataValueDescriptor to
StandardException
public final void setValue(java.lang.Float theValue) throws StandardException
NumberDataValue
setValue
in interface NumberDataValue
theValue
- A Float containing the value to set this
NumberDataValue to. Null means set the value
to SQL null.
StandardException
- Thrown on errorNumberDataValue.setValue(java.lang.Integer)
public final void setValue(java.lang.Boolean theValue) throws StandardException
NumberDataValue
setValue
in interface NumberDataValue
theValue
- Contains the boolean value to set this to
StandardException
NumberDataValue.setValue(java.lang.Integer)
protected final boolean objectNull(java.lang.Object o)
public static float normalizeREAL(float v) throws StandardException
StandardException
public static float normalizeREAL(double v) throws StandardException
StandardException
public static double normalizeDOUBLE(double v) throws StandardException
StandardException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |