Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.types
Interface NumberDataValue  view NumberDataValue download NumberDataValue.java

All Superinterfaces:
DataValueDescriptor, java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, Orderable, java.io.Serializable, org.apache.derby.iapi.services.io.Storable, org.apache.derby.iapi.services.io.TypedFormat
All Known Implementing Classes:
NumberDataType

public interface NumberDataValue
extends DataValueDescriptor


Field Summary
static int MAX_DECIMAL_PRECISION_SCALE
           
static int MIN_DECIMAL_DIVIDE_SCALE
          The minimum scale when dividing Decimals
 
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
 
Method Summary
 NumberDataValue absolute(NumberDataValue result)
          The SQL ABSOLUTE operator.
 NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result)
          The SQL / operator.
 NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale)
          The SQL / operator.
 int getDecimalValuePrecision()
          Return the SQL precision of this specific DECIMAL value.
 int getDecimalValueScale()
          Return the SQL scale of this specific DECIMAL value.
 NumberDataValue minus(NumberDataValue result)
          The SQL unary - operator.
 NumberDataValue minus(NumberDataValue left, NumberDataValue right, NumberDataValue result)
          The SQL - operator.
 NumberDataValue mod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result)
          The SQL mod operator.
 NumberDataValue plus(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result)
          The SQL + operator.
 void setValue(java.lang.Number theValue)
          Set the value of this NumberDataValue to the given value.
 NumberDataValue sqrt(NumberDataValue result)
          The SQL SQRT operator.
 NumberDataValue times(NumberDataValue left, NumberDataValue right, NumberDataValue result)
          The SQL * operator.
 
Methods inherited from interface org.apache.derby.iapi.types.DataValueDescriptor
checkHostVariable, coalesce, compare, compare, equals, estimateMemoryUsage, 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, setBigDecimal, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFromResultSet, typePrecedence, typeToBigDecimal
 
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
 

Field Detail

MIN_DECIMAL_DIVIDE_SCALE

public static final int MIN_DECIMAL_DIVIDE_SCALE
The minimum scale when dividing Decimals

See Also:
Constant Field Values

MAX_DECIMAL_PRECISION_SCALE

public static final int MAX_DECIMAL_PRECISION_SCALE
See Also:
Constant Field Values
Method Detail

plus

public NumberDataValue plus(NumberDataValue addend1,
                            NumberDataValue addend2,
                            NumberDataValue result)
                     throws org.apache.derby.iapi.error.StandardException
The SQL + operator.


minus

public NumberDataValue minus(NumberDataValue left,
                             NumberDataValue right,
                             NumberDataValue result)
                      throws org.apache.derby.iapi.error.StandardException
The SQL - operator.


times

public NumberDataValue times(NumberDataValue left,
                             NumberDataValue right,
                             NumberDataValue result)
                      throws org.apache.derby.iapi.error.StandardException
The SQL * operator.


divide

public NumberDataValue divide(NumberDataValue dividend,
                              NumberDataValue divisor,
                              NumberDataValue result)
                       throws org.apache.derby.iapi.error.StandardException
The SQL / operator.


divide

public NumberDataValue divide(NumberDataValue dividend,
                              NumberDataValue divisor,
                              NumberDataValue result,
                              int scale)
                       throws org.apache.derby.iapi.error.StandardException
The SQL / operator.


mod

public NumberDataValue mod(NumberDataValue dividend,
                           NumberDataValue divisor,
                           NumberDataValue result)
                    throws org.apache.derby.iapi.error.StandardException
The SQL mod operator.


minus

public NumberDataValue minus(NumberDataValue result)
                      throws org.apache.derby.iapi.error.StandardException
The SQL unary - operator. Negates this NumberDataValue.


absolute

public NumberDataValue absolute(NumberDataValue result)
                         throws org.apache.derby.iapi.error.StandardException
The SQL ABSOLUTE operator. Absolute value of this NumberDataValue.


sqrt

public NumberDataValue sqrt(NumberDataValue result)
                     throws org.apache.derby.iapi.error.StandardException
The SQL SQRT operator. Sqrt value of this NumberDataValue.


setValue

public void setValue(java.lang.Number theValue)
              throws org.apache.derby.iapi.error.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


getDecimalValuePrecision

public int getDecimalValuePrecision()
Return the SQL precision of this specific DECIMAL value. This does not match the return from BigDecimal.precision() added in J2SE 5.0, which represents the precision of the unscaled value. If the value does not represent a SQL DECIMAL then the return is undefined.


getDecimalValueScale

public int getDecimalValueScale()
Return the SQL scale of this specific DECIMAL value. This does not match the return from BigDecimal.scale() since in J2SE 5.0 onwards that can return negative scales. If the value does not represent a SQL DECIMAL then the return is undefined.