DataType
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final BigDecimal | |
| pack-priv static final BigDecimal |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final NumberDataValue | Returns: this object's absolute value. Null if object is null.The result of the previous call to this method, null
if not called yet. result)Implements org. Numbers check for isNegative first and negate it if negative. |
| public final int | compare(DataValueDescriptor
The Orderable to compare this one to. arg)Implements org. Compare this Orderable with a given Orderable for the purpose of index positioning. |
| public final boolean | compare(int
Orderable.ORDER_OP_EQUALS means do an = comparison.
Orderable.ORDER_OP_LESSTHAN means compare this < other.
Orderable.ORDER_OP_LESSOREQUALS means compare this <= other. op, DataValueDescriptor The DataValueDescriptor to compare this one to. other, boolean True means to treat nulls as ordered values,
that is, treat SQL null as equal to null, and less
than all other values.
False means to treat nulls as unknown values,
that is, the result of any comparison with a null
is the UNKNOWN truth value. orderedNulls, boolean The return value to use if the result of the
comparison is the UNKNOWN truth value. In other
words, if orderedNulls is false, and a null is
involved in the comparison, return unknownRV.
This parameter is not used orderedNulls is true. unknownRV)Overrides org. Implements org. Compare this Orderable with a given Orderable for the purpose of qualification and sorting. |
| public NumberDataValue | Returns: A SQLInteger containing the result of the divisionThe numerator dividend, NumberDataValue The denominator divisor, NumberDataValue The result of a previous call to this method, null
if not called yet result)Implements org. This method implements the / operator for TINYINT, SMALLINT and INTEGER. |
| public NumberDataValue | divide(NumberDataValue
The numerator dividend, NumberDataValue The denominator divisor, NumberDataValue The result of the previous call to this method, null
if not called yet. result, int The scale of the result, for decimal type. If pass
in value < 0, can calculate it dynamically. scale)Implements org. Suitable for integral types that ignore scale. |
| private static Context | getContextOrNull(final String contextID)
Must be private so that user code can't call this entry point. |
| protected abstract boolean | Returns: A boolean. If this.value is negative, return true. For positive values or null, return false.The isNegative abstract method. |
| public NumberDataValue | Returns: A SQLInteger containing the result of the subtractionThe value to be subtracted from left, NumberDataValue The value to be subtracted right, NumberDataValue The result of a previous call to this method, null
if not called yet result)Implements org. This method implements the - operator for TINYINT, SMALLINT and INTEGER. |
| public NumberDataValue | mod(NumberDataValue
The numerator dividend, NumberDataValue The denominator divisor, NumberDataValue The result of the previous call to this method, null
if not called yet. result)Implements org. The SQL mod operator. |
| public static double | normalizeDOUBLE(double v)
normalizeDOUBLE normalizes the value, so that negative zero (-0.0) becomes positive. |
| public static float | normalizeREAL(float v)
normalizeREAL normalizes the value, so that negative zero (-0.0) becomes positive. |
| public static float | normalizeREAL(final double v)
normalizeREAL normalizes the value, so that negative zero (-0.0) becomes positive. |
| protected final boolean | |
| public NumberDataValue | Returns: A NumberDataValue containing the result of the additionOne of the addends addend1, NumberDataValue The other addend addend2, NumberDataValue The result of a previous call to this method, null
if not called yet result)Implements org. This method implements the + operator for TINYINT,SMALLINT,INT. |
| public void | setBigDecimal(BigDecimal
required to be a BigDecimal or null. bigDecimal)Overrides org. Implements org. setValue for integral exact numerics. |
| pack-priv void | setObject(Object theValue)
Overrides org. Set the value from a correctly typed Integer object. |
| public void | setValue(short
The value to set this DataValueDescriptor to theValue)Overrides org. Implements org. Common code to handle converting a short to this value by using the int to this value conversion. |
| public void | setValue(byte
The value to set this DataValueDescriptor to theValue)Overrides org. Implements org. Common code to handle converting a byte to this value by using the int to this value conversion. |
| public void | setValue(Number
An Number containing the value to set this
NumberDataValue to. Null means set the value
to SQL null. theValue)Implements org. Common code to handle java.lang.Integer as a Number, used for TINYINT, SMALLINT, INTEGER |
| public NumberDataValue | Returns: this object's sqrt value. Null if object is null.Note -0.0f and -0.0d returns 0.0f and 0.0d. The result of the previous call to this method, null
if not call yet. result)Implements org. This is the sqrt method. |
| protected abstract int | |
| public int | typeToBigDecimal()
Overrides org. Implements org. Implementation for integral types. |
| private static boolean | Returns: false if dictionary is new enough, see DD_Version.Controls use of old DB2 limits (DERBY-3398). |
| MAXLONG_PLUS_ONE | back to summary |
|---|---|
| pack-priv static final BigDecimal MAXLONG_PLUS_ONE | |
| MINLONG_MINUS_ONE | back to summary |
|---|---|
| pack-priv static final BigDecimal MINLONG_MINUS_ONE | |
| NumberDataType | back to summary |
|---|---|
| public NumberDataType() | |
| absolute | back to summary |
|---|---|
| public final NumberDataValue absolute(NumberDataValue result) throws StandardException Implements org. Numbers check for isNegative first and negate it if negative.
| |
| compare | back to summary |
|---|---|
| public final int compare(DataValueDescriptor arg) throws StandardException Implements org. Doc from org. Compare this Orderable with a given Orderable for the purpose of index positioning. This method treats nulls as ordered values - that is, it treats SQL null as equal to null and greater than all other values.
| |
| compare | back to summary |
|---|---|
| public final boolean compare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException Overrides org. Implements org. Doc from org. Compare this Orderable with a given Orderable for the purpose of qualification and sorting. The caller gets to determine how nulls should be treated - they can either be ordered values or unknown values.
| |
| divide | back to summary |
|---|---|
| public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException Implements org. This method implements the / operator for TINYINT, SMALLINT and INTEGER. Specialized methods are not required for TINYINT and SMALLINT as the Java virtual machine always executes byte and int division as integer.
| |
| divide | back to summary |
|---|---|
| public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale) throws StandardException Implements org. Suitable for integral types that ignore scale.
| |
| getContextOrNull | back to summary |
|---|---|
| private static Context getContextOrNull(final String contextID) Must be private so that user code can't call this entry point. | |
| isNegative | back to summary |
|---|---|
| protected abstract boolean isNegative() The isNegative abstract method. Checks to see if this.value is negative. To be implemented by each NumberDataType.
| |
| minus | back to summary |
|---|---|
| public NumberDataValue minus(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException Implements org. This method implements the - operator for TINYINT, SMALLINT and INTEGER.
| |
| mod | back to summary |
|---|---|
| public NumberDataValue mod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException Implements org. Doc from org. The SQL mod operator.
| |
| normalizeDOUBLE | back to summary |
|---|---|
| public static double normalizeDOUBLE(double v) throws StandardException normalizeDOUBLE normalizes the value, so that negative zero (-0.0) becomes positive.
| |
| normalizeREAL | back to summary |
|---|---|
| public static float normalizeREAL(float v) throws StandardException normalizeREAL normalizes the value, so that negative zero (-0.0) becomes positive.
| |
| normalizeREAL | back to summary |
|---|---|
| public static float normalizeREAL(final double v) throws StandardException normalizeREAL normalizes the value, so that negative zero (-0.0) becomes positive.
The reason for having normalizeREAL with two signatures is to
avoid that normalizeREAL is accidentally called with a casted
| |
| objectNull | back to summary |
|---|---|
| protected final boolean objectNull(Object o) | |
| plus | back to summary |
|---|---|
| public NumberDataValue plus(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result) throws StandardException Implements org. This method implements the + operator for TINYINT,SMALLINT,INT.
| |
| setBigDecimal | back to summary |
|---|---|
| public void setBigDecimal(BigDecimal bigDecimal) throws StandardException Overrides org. Implements org. setValue for integral exact numerics. Converts the BigDecimal to a long to preserve precision
| |
| setObject | back to summary |
|---|---|
| pack-priv void setObject(Object theValue) throws StandardException Overrides org. Set the value from a correctly typed Integer object. Used for TINYINT, SMALLINT, INTEGER. | |
| setValue | back to summary |
|---|---|
| public void setValue(short theValue) throws StandardException Overrides org. Implements org. Common code to handle converting a short to this value by using the int to this value conversion. Simply calls setValue(int).
| |
| setValue | back to summary |
|---|---|
| public void setValue(byte theValue) throws StandardException Overrides org. Implements org. Common code to handle converting a byte to this value by using the int to this value conversion. Simply calls setValue(int).
| |
| setValue | back to summary |
|---|---|
| public void setValue(Number theValue) throws StandardException Implements org. Common code to handle java.lang.Integer as a Number, used for TINYINT, SMALLINT, INTEGER
| |
| sqrt | back to summary |
|---|---|
| public NumberDataValue sqrt(NumberDataValue result) throws StandardException Implements org. This is the sqrt method.
| |
| typeCompare | back to summary |
|---|---|
| protected abstract int typeCompare(DataValueDescriptor arg) throws StandardException Compare this (not null) to a non-null value.
| |
| typeToBigDecimal | back to summary |
|---|---|
| public int typeToBigDecimal() Overrides org. Implements org. Implementation for integral types. Convert to a BigDecimal using long
| |
| useDB2Limits | back to summary |
|---|---|
| private static boolean useDB2Limits() throws StandardException Controls use of old DB2 limits (DERBY-3398).
| |