| java.lang.Object org.apache.derby.iapi.types.DataType org.apache.derby.iapi.types.NumberDataType org.apache.derby.iapi.types.BinaryDecimal org.apache.derby.iapi.types.BigIntegerDecimal
BigIntegerDecimal | final public class BigIntegerDecimal extends BinaryDecimal (Code) | | DECIMAL support using the immutable java.math.BigInteger to perform arithmetic
and conversions. Extends BinaryDecimal to use the base
support of that class. J2ME/CDC/Foundation includes BigInteger.
A BigInteger is used in calculations etc. to represent the integral unscaled value.
It is simply created from new BigInteger(data2c). No additional instance fields
are used by this class, a possible enhancement would be to keep the BigInteger around
but would require calls from the parent class to reset state etc.
|
Method Summary | |
public NumberDataValue | divideNN(NumberDataValue left, NumberDataValue right, NumberDataValue result, int scale) Divide two non-null NumberDataValues using DECIMAL arithmetic. | public boolean | getBoolean() | public int | getDecimalValuePrecision() Return the SQL precision of this value. | public double | getDouble() | public float | getFloat() | public long | getLong() | public DataValueDescriptor | getNewNull() | public String | getString() | public NumberDataValue | minus(NumberDataValue result) Negate the number. | public void | normalize(DataTypeDescriptor desiredType, DataValueDescriptor source) | public NumberDataValue | plusNN(NumberDataValue left, NumberDataValue right, NumberDataValue result) Add two non-null NumberDataValues using DECIMAL arithmetic. | public void | setValue(String theValue) Set the value from a String, the format is
nnnn
Scale always set to zero. | public void | setWidth(int desiredPrecision, int desiredScale, boolean errorOnTrunc) | public NumberDataValue | timesNN(NumberDataValue left, NumberDataValue right, NumberDataValue result) Multiple two non-null NumberDataValues using DECIMAL arithmetic. | public String | toString() | protected int | typeCompare(DataValueDescriptor arg) Compare two non-null NumberDataValues using DECIMAL arithmetic. |
BigIntegerDecimal | public BigIntegerDecimal()(Code) | | |
divideNN | public NumberDataValue divideNN(NumberDataValue left, NumberDataValue right, NumberDataValue result, int scale) throws StandardException(Code) | | Divide two non-null NumberDataValues using DECIMAL arithmetic.
Uses divide() to perform the calculation.
Simply multiply the unscaled values and subtract the scales, proof:
left / right
= (left_unscaled * 10^-left_scale) / (right_unscaled * 10^-right_scale)
= (left_unscaled / right_unscaled) * (10^-left_scale / 10^-right_scale)
= (left_unscaled / right_unscaled) * (10^-(left_scale-right_scale))
|
getBoolean | public boolean getBoolean()(Code) | | |
getDecimalValuePrecision | public int getDecimalValuePrecision()(Code) | | Return the SQL precision of this value.
|
setValue | public void setValue(String theValue) throws StandardException(Code) | | Set the value from a String, the format is
nnnn
Scale always set to zero.
|
setWidth | public void setWidth(int desiredPrecision, int desiredScale, boolean errorOnTrunc) throws StandardException(Code) | | |
timesNN | public NumberDataValue timesNN(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException(Code) | | Multiple two non-null NumberDataValues using DECIMAL arithmetic.
Uses BigInteger.multipy() to perform the calculation.
Simply multiply the unscaled values and add the scales, proof:
left * right
= (left_unscaled * 10^-left_scale) * (right_unscaled * 10^-right_scale)
= (left_unscaled * 10^-left_scale) * (right_unscaled * 10^-right_scale)
= (left_unscaled * right_unscaled) * 10^-(left_scale + right_scale)
|
Methods inherited from org.apache.derby.iapi.types.BinaryDecimal | public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException(Code)(Java Doc) final public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale) throws StandardException(Code)(Java Doc) abstract public NumberDataValue divideNN(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale) throws StandardException(Code)(Java Doc) public int estimateMemoryUsage()(Code)(Java Doc) final public byte getByte() throws StandardException(Code)(Java Doc) public DataValueDescriptor getClone()(Code)(Java Doc) public int getDecimalValueScale()(Code)(Java Doc) final public int getInt() throws StandardException(Code)(Java Doc) final public int getLength()(Code)(Java Doc) final public short getShort() throws StandardException(Code)(Java Doc) final public int getTypeFormatId()(Code)(Java Doc) final public String getTypeName()(Code)(Java Doc) public int hashCode()(Code)(Java Doc) protected boolean isNegative()(Code)(Java Doc) public boolean isNull()(Code)(Java Doc) final public NumberDataValue minus(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException(Code)(Java Doc) public NumberDataValue minusNN(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException(Code)(Java Doc) final public NumberDataValue plus(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result) throws StandardException(Code)(Java Doc) abstract public NumberDataValue plusNN(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result) throws StandardException(Code)(Java Doc) public void readExternal(ObjectInput in) throws IOException(Code)(Java Doc) public void readExternalFromArray(ArrayInputStream in) throws IOException(Code)(Java Doc) public void restoreToNull()(Code)(Java Doc) protected void setFrom(DataValueDescriptor dvd) throws StandardException(Code)(Java Doc) public void setValue(long theValue)(Code)(Java Doc) final public void setValue(int theValue)(Code)(Java Doc) public void setValue(boolean theValue)(Code)(Java Doc) final public void setValue(double theValue) throws StandardException(Code)(Java Doc) final public void setValue(float theValue) throws StandardException(Code)(Java Doc) public void setValue(Number theValue) throws StandardException(Code)(Java Doc) public void setValueFromResultSet(ResultSet resultSet, int colNumber, boolean isNullable) throws StandardException, SQLException(Code)(Java Doc) final public NumberDataValue times(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException(Code)(Java Doc) abstract public NumberDataValue timesNN(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException(Code)(Java Doc) final public int typePrecedence()(Code)(Java Doc) final public int typeToBigDecimal()(Code)(Java Doc) public void writeExternal(ObjectOutput out) throws IOException(Code)(Java Doc)
|
Methods inherited from org.apache.derby.iapi.types.NumberDataType | final public NumberDataValue absolute(NumberDataValue result) throws StandardException(Code)(Java Doc) final public int compare(DataValueDescriptor arg) throws StandardException(Code)(Java Doc) final public boolean compare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException(Code)(Java Doc) public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException(Code)(Java Doc) public NumberDataValue divide(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result, int scale) throws StandardException(Code)(Java Doc) public int getDecimalValuePrecision()(Code)(Java Doc) public int getDecimalValueScale()(Code)(Java Doc) abstract protected boolean isNegative()(Code)(Java Doc) public NumberDataValue minus(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException(Code)(Java Doc) public NumberDataValue mod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException(Code)(Java Doc) public static double normalizeDOUBLE(double v) throws StandardException(Code)(Java Doc) public static float normalizeREAL(float v) throws StandardException(Code)(Java Doc) public static float normalizeREAL(double v) throws StandardException(Code)(Java Doc) final protected boolean objectNull(Object o)(Code)(Java Doc) public NumberDataValue plus(NumberDataValue addend1, NumberDataValue addend2, NumberDataValue result) throws StandardException(Code)(Java Doc) public void setBigDecimal(Number bigDecimal) throws StandardException(Code)(Java Doc) void setObject(Object theValue) throws StandardException(Code)(Java Doc) public void setValue(short theValue) throws StandardException(Code)(Java Doc) public void setValue(byte theValue) throws StandardException(Code)(Java Doc) public void setValue(Number theValue) throws StandardException(Code)(Java Doc) public NumberDataValue sqrt(NumberDataValue result) throws StandardException(Code)(Java Doc) abstract protected int typeCompare(DataValueDescriptor arg) throws StandardException(Code)(Java Doc) public int typeToBigDecimal()(Code)(Java Doc)
|
Methods inherited from org.apache.derby.iapi.types.DataType | public void checkHostVariable(int declaredLength) throws StandardException(Code)(Java Doc) public Object cloneObject()(Code)(Java Doc) public DataValueDescriptor coalesce(DataValueDescriptor[] argumentsList, DataValueDescriptor returnValue) throws StandardException(Code)(Java Doc) public boolean compare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException(Code)(Java Doc) final protected StandardException dataTypeConversion(String targetType)(Code)(Java Doc) public BooleanDataValue equals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc) public boolean equals(Object other)(Code)(Java Doc) protected static int flip(int operator)(Code)(Java Doc) void genericSetObject(Object theValue) throws StandardException(Code)(Java Doc) public boolean getBoolean() throws StandardException(Code)(Java Doc) public byte getByte() throws StandardException(Code)(Java Doc) public byte[] getBytes() throws StandardException(Code)(Java Doc) public Date getDate(Calendar cal) throws StandardException(Code)(Java Doc) public double getDouble() throws StandardException(Code)(Java Doc) public float getFloat() throws StandardException(Code)(Java Doc) public int getInt() throws StandardException(Code)(Java Doc) public long getLong() throws StandardException(Code)(Java Doc) protected String getNationalString(LocaleFinder localeFinder) throws StandardException(Code)(Java Doc) public Object getObject() throws StandardException(Code)(Java Doc) public short getShort() throws StandardException(Code)(Java Doc) public InputStream getStream() throws StandardException(Code)(Java Doc) public Time getTime(Calendar cal) throws StandardException(Code)(Java Doc) public Timestamp getTimestamp(Calendar cal) throws StandardException(Code)(Java Doc) public String getTraceString() throws StandardException(Code)(Java Doc) String getTypeName(String className)(Code)(Java Doc) public BooleanDataValue greaterOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc) public BooleanDataValue greaterThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc) public BooleanDataValue in(DataValueDescriptor left, DataValueDescriptor[] inList, boolean orderedList) throws StandardException(Code)(Java Doc) final protected StandardException invalidFormat()(Code)(Java Doc) final public BooleanDataValue isNotNull()(Code)(Java Doc) final public BooleanDataValue isNullOp()(Code)(Java Doc) public BooleanDataValue lessOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc) public BooleanDataValue lessThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc) public void normalize(DataTypeDescriptor desiredType, DataValueDescriptor source) throws StandardException(Code)(Java Doc) public BooleanDataValue notEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException(Code)(Java Doc) final protected StandardException outOfRange()(Code)(Java Doc) public void setBigDecimal(Number bigDecimal) throws StandardException(Code)(Java Doc) protected void setFrom(DataValueDescriptor dvd) throws StandardException(Code)(Java Doc) public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException(Code)(Java Doc) public void setInto(ResultSet rs, int position) throws SQLException, StandardException(Code)(Java Doc) void setObject(Object theValue) throws StandardException(Code)(Java Doc) public void setObjectForCast(Object theValue, boolean instanceOfResultType, String resultTypeClassName) throws StandardException(Code)(Java Doc) public void setToNull()(Code)(Java Doc) public void setValue(Time theValue) throws StandardException(Code)(Java Doc) public void setValue(Time theValue, Calendar cal) throws StandardException(Code)(Java Doc) public void setValue(Timestamp theValue) throws StandardException(Code)(Java Doc) public void setValue(Timestamp theValue, Calendar cal) throws StandardException(Code)(Java Doc) public void setValue(Date theValue) throws StandardException(Code)(Java Doc) public void setValue(Date theValue, Calendar cal) throws StandardException(Code)(Java Doc) public void setValue(String theValue) throws StandardException(Code)(Java Doc) public void setValue(int theValue) throws StandardException(Code)(Java Doc) public void setValue(double theValue) throws StandardException(Code)(Java Doc) public void setValue(float theValue) throws StandardException(Code)(Java Doc) public void setValue(short theValue) throws StandardException(Code)(Java Doc) public void setValue(long theValue) throws StandardException(Code)(Java Doc) public void setValue(byte theValue) throws StandardException(Code)(Java Doc) public void setValue(boolean theValue) throws StandardException(Code)(Java Doc) public void setValue(byte[] theValue) throws StandardException(Code)(Java Doc) final public void setValue(DataValueDescriptor dvd) throws StandardException(Code)(Java Doc) public void setValue(InputStream theStream, int valueLength) throws StandardException(Code)(Java Doc) public void throwLangSetMismatch(Object value) throws StandardException(Code)(Java Doc) void throwLangSetMismatch(String argTypeName) throws StandardException(Code)(Java Doc) public int typePrecedence()(Code)(Java Doc) public int typeToBigDecimal() throws StandardException(Code)(Java Doc)
|
|
|