Top Fields Methods
org.apache.derby.iapi.types

public Interface NumberDataValue

extends DataValueDescriptor
Known Direct Implementers
org.apache.derby.iapi.types.NumberDataType
Imports
org.apache.derby.shared.common.error.StandardException

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
MIN_DECIMAL_DIVIDE_SCALE

The minimum scale when dividing Decimals

Inherited from org.apache.derby.iapi.types.DataValueDescriptor:
UNKNOWN_LOGICAL_LENGTH

Method Summary

Modifier and TypeMethod and Description
public NumberDataValue
absolute(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

The SQL ABSOLUTE operator.

public NumberDataValue

Returns:

dividend / divisor
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
)

The SQL / operator.

public NumberDataValue

Returns:

dividend / divisor
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
)

The SQL / operator.

public NumberDataValue

Returns:

left - right
minus
(NumberDataValue
The left operand
left
,
NumberDataValue
The right operand
right
,
NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

The SQL - operator.

public NumberDataValue

Returns:

- operand
minus
(NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

The SQL unary - operator.

public NumberDataValue

Returns:

dividend / divisor
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
)

The SQL mod operator.

public NumberDataValue

Returns:

The sum of the two addends
plus
(NumberDataValue
One of the addends
addend1
,
NumberDataValue
The other addend
addend2
,
NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

The SQL + operator.

public void
setValue(Number
An Number containing the value to set this NumberDataValue to. Null means set the value to SQL null.
theValue
)

Set the value of this NumberDataValue to the given value.

public NumberDataValue
sqrt(NumberDataValue
The result of the previous call to this method, null if not call yet.
result
)

The SQL SQRT operator.

public NumberDataValue

Returns:

left * right
times
(NumberDataValue
The left operand
left
,
NumberDataValue
The right operand
right
,
NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

The SQL * operator.

Inherited from org.apache.derby.iapi.types.DataValueDescriptor:
checkHostVariablecloneHoldercloneValuecoalescecomparecomparecomparecompareequalsestimateMemoryUsagegetBooleangetBytegetBytesgetDategetDoublegetFloatgetIntgetLengthgetLonggetNewNullgetObjectgetShortgetStreamgetStringgetTimegetTimestampgetTraceStringgetTypeNamegreaterOrEqualsgreaterThanhasStreaminisNotNullisNullOplessOrEqualslessThannormalizenotEqualsreadExternalFromArrayrecyclesetBigDecimalsetIntosetIntosetObjectForCastsetToNullsetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValueFromResultSettypePrecedencetypeToBigDecimal

Field Detail

MAX_DECIMAL_PRECISION_SCALEback to summary
public static final int MAX_DECIMAL_PRECISION_SCALE
MIN_DECIMAL_DIVIDE_SCALEback to summary
public static final int MIN_DECIMAL_DIVIDE_SCALE

The minimum scale when dividing Decimals

Method Detail

absoluteback to summary
public NumberDataValue absolute(NumberDataValue result) throws StandardException

The SQL ABSOLUTE operator. Absolute value of this NumberDataValue.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.
divideback to summary
public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException

The SQL / operator.

Parameters
dividend:NumberDataValue

The numerator

divisor:NumberDataValue

The denominator

result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

dividend / divisor

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.
divideback to summary
public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale) throws StandardException

The SQL / operator.

Parameters
dividend:NumberDataValue

The numerator

divisor:NumberDataValue

The denominator

result:NumberDataValue

The result of the previous call to this method, null if not called yet.

scale:int

The scale of the result, for decimal type. If pass in value < 0, can calculate it dynamically.

Returns:NumberDataValue

dividend / divisor

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.
minusback to summary
public NumberDataValue minus(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException

The SQL - operator.

Parameters
left:NumberDataValue

The left operand

right:NumberDataValue

The right operand

result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

left - right

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.
minusback to summary
public NumberDataValue minus(NumberDataValue result) throws StandardException

The SQL unary - operator. Negates this NumberDataValue.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

- operand

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.
modback to summary
public NumberDataValue mod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException

The SQL mod operator.

Parameters
dividend:NumberDataValue

The numerator

divisor:NumberDataValue

The denominator

result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

dividend / divisor

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.
plusback to summary
public NumberDataValue plus(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result) throws StandardException

The SQL + operator.

Parameters
addend1:NumberDataValue

One of the addends

addend2:NumberDataValue

The other addend

result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

The sum of the two addends

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.
setValueback to summary
public void setValue(Number theValue) throws StandardException

Set the value of this NumberDataValue to the given value. This is only intended to be called when mapping values from the Java space into the SQL space, e.g. parameters and return types from procedures and functions. Each specific type is only expected to handle the explicit type according the JDBC.

  • SMALLINT from java.lang.Integer
  • INTEGER from java.lang.Integer
  • LONG from java.lang.Long
  • FLOAT from java.lang.Float
  • DOUBLE from java.lang.Double
  • DECIMAL from java.math.BigDecimal
Parameters
theValue:Number

An Number containing the value to set this NumberDataValue to. Null means set the value to SQL null.

sqrtback to summary
public NumberDataValue sqrt(NumberDataValue result) throws StandardException

The SQL SQRT operator. Sqrt value of this NumberDataValue.

Parameters
result:NumberDataValue

The result of the previous call to this method, null if not call yet.

Exceptions
StandardException:
Thrown on error (a negative number), if result is non-null then its value will be unchanged.
timesback to summary
public NumberDataValue times(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException

The SQL * operator.

Parameters
left:NumberDataValue

The left operand

right:NumberDataValue

The right operand

result:NumberDataValue

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

left * right

Exceptions
StandardException:
Thrown on error, if result is non-null then its value will be unchanged.