com.sap.ip.me.api.smartsync
Class FixedDecimal

java.lang.Object
  extended bycom.sap.ip.me.api.smartsync.FixedDecimal
All Implemented Interfaces:
java.io.Serializable

Deprecated. since 2.5

public class FixedDecimal
extends java.lang.Object
implements java.io.Serializable

A FixedDecimal is an immutable, arbitrary-precision signed decimal number. It consists of an arbitrary precision unscaled integer value and a non-negative 32-bit integer scale, which represents the number of digits to the right of the decimal point. The number represented by the FixedDecimal is (unscaledValue/10scale). FixedDecimal provides operations for basic arithmetic, comparison, and format conversion.
The string represenation of a FixedDecimal has the following parts:

The string must contain at least one digit in either the integer or the fraction part.

Version:
2.1
Author:
SAP
See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Deprecated. The serial version ID
 
Constructor Summary
FixedDecimal(java.lang.String iStringVal, int iLen, int iDec)
          Deprecated. Constructs a FixedDecimal instance with the specified String representation of a decimal number, length and decimal digit length.
FixedDecimal(java.lang.String iFormattedVal, java.util.Locale local, int iLen, int iDec)
          Deprecated. Constructs a FixedDecimal instance with the specified String representation of a decimal number, the locale of the string representation, length and decimal digit length.
 
Method Summary
 FixedDecimal add(FixedDecimal iVal)
          Deprecated. Returns the sum of this FixedDecimal and the specified FixedDecimal parameter.
 java.math.BigDecimal bigDecimalValue()
          Deprecated. Return the BigDecimal value of this FixedDecimal.
 int compareTo(FixedDecimal iVal)
          Deprecated. Compares this FixedDecimal with the specified FixedDecimal regardless of their total lengths nor decimal digit lengths.
 FixedDecimal copy()
          Deprecated. Clones this FixedDecimal instance
 FixedDecimal divide(FixedDecimal iVal)
          Deprecated. Returns the quotient when this FixedDecimal is divided by the specified FixedDecimal value.
 double doubleValue()
          Deprecated. Returns the double value of this FixedDecimal.
 boolean equals(java.lang.Object o)
          Deprecated. Compares two Objects for equality.
 float floatValue()
          Deprecated. Returns the float value of this FixedDecimal.
 java.lang.String formattedString(java.util.Locale local)
          Deprecated. Converts this FixedDecimal to a formatted string of the specified Locale.
 int getDecimals()
          Deprecated. Returns the decimals length
 int getLength()
          Deprecated. Returns the total fixed length.
 int hashCode()
          Deprecated. Returns the hash code value of this FixedDecimal.
 FixedDecimal multiply(FixedDecimal iVal)
          Deprecated. Returns the product of this FixedDecimal and the specified FixedDecimal parameter.
 FixedDecimal negate()
          Deprecated. Returns the negative value of this FixedDecimal.
 java.lang.String stringValue()
          Deprecated. Returns the String representation of this FixedDecimal.
 java.lang.String toString()
          Deprecated. Returns the String representation of this FixedDecimal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Deprecated. 
The serial version ID

See Also:
Constant Field Values
Constructor Detail

FixedDecimal

public FixedDecimal(java.lang.String iStringVal,
                    int iLen,
                    int iDec)
             throws java.lang.NumberFormatException
Deprecated. 
Constructs a FixedDecimal instance with the specified String representation of a decimal number, length and decimal digit length.
For example:
   FixedDecimal orderPrice = new FixedDecimal("-123456.22", 16, 2);
 

Parameters:
iStringVal - decimal representation in String
iLen - maximum length excluding the decimal point and sign
iDec - fractional part length
Throws:
java.lang.NumberFormatException - is thrown if the specified decimal string is null or is an invalid numerical string representation.

FixedDecimal

public FixedDecimal(java.lang.String iFormattedVal,
                    java.util.Locale local,
                    int iLen,
                    int iDec)
             throws java.lang.NumberFormatException
Deprecated. 
Constructs a FixedDecimal instance with the specified String representation of a decimal number, the locale of the string representation, length and decimal digit length. The String representation should be formatted for the specified locale. Refer to ISO Country Code list for details.
For example:
   FixedDecimal orderPrice = new FixedDecimal("-123.456,22",Locale.GERMANY, 16, 2);
  

Parameters:
iFormattedVal - the formatted decimal string
local - the Locale to which the format of the specified decimal representation is based
iLen - maximum length excluding the decimal point and sign
iDec - fractional part length
Throws:
java.lang.NumberFormatException - is thrown if the specified decimal string is null or is an invalid numerical string representation.
Method Detail

add

public FixedDecimal add(FixedDecimal iVal)
Deprecated. 
Returns the sum of this FixedDecimal and the specified FixedDecimal parameter. The resulting value will have the following characteristics:
- a value of (this + val)
- a length value will be set to the bigger length value among elements
- a decimal length value will be set to the bigger decimal length value among elements

Parameters:
iVal - the FixedDecimal to be added to this FixedDecimal
Returns:
the sum value in FixedDecimal format

multiply

public FixedDecimal multiply(FixedDecimal iVal)
Deprecated. 
Returns the product of this FixedDecimal and the specified FixedDecimal parameter. The resulting value will have the following characteristics:
- a value of (this * val)
- a length value will be set to the bigger length value among elements
- a decimal length value will be set to the bigger decimal length value among elements

Parameters:
iVal - the muliplier FixedDecimal
Returns:
the product value in FixedDecimal format

divide

public FixedDecimal divide(FixedDecimal iVal)
Deprecated. 
Returns the quotient when this FixedDecimal is divided by the specified FixedDecimal value. The resulting value will have the following characteristics:
- a value of (this / val)
- a length value equal to this FixedDecimal length value
- a decimal length value equal to this FixedDecimal decimal length value

Parameters:
iVal - the divisor FixedDecimal
Returns:
the quotient value in FixedDecimal format

negate

public FixedDecimal negate()
Deprecated. 
Returns the negative value of this FixedDecimal.

Returns:
the negative value of this FixedDecimal

compareTo

public int compareTo(FixedDecimal iVal)
Deprecated. 
Compares this FixedDecimal with the specified FixedDecimal regardless of their total lengths nor decimal digit lengths.

Parameters:
iVal - the FixedDecimal instance to be compared to this intance
Returns:
-1 if this FixedDecimal is less than the specified FixedDecimal value,
0 if both is equal
1 if this FixedDecimal is greater than the specified FixedDecimal value,

toString

public java.lang.String toString()
Deprecated. 
Returns the String representation of this FixedDecimal

Returns:
the String representation of this FixedDecimal

stringValue

public java.lang.String stringValue()
Deprecated. 
Returns the String representation of this FixedDecimal. A leading minus sign is used to indicate sign, and the number of digits to the right of the decimal point is used to indicate the scale.

Returns:
the string representation of this FixedDecimal

copy

public FixedDecimal copy()
Deprecated. 
Clones this FixedDecimal instance

Returns:
the cloned instance of this FixedDecimal

formattedString

public java.lang.String formattedString(java.util.Locale local)
Deprecated. 
Converts this FixedDecimal to a formatted string of the specified Locale.
For example, a value of "1100.23" will be formatted on their Locale specific format as follows:
    Locale.US      -  "1,100.23"
    Locale.GERMANY -  "1.100,23"
  

Parameters:
local - the local to which the format ot te string representation will be based.
Returns:
the locally formatted string representation of this FixedDecimal

doubleValue

public double doubleValue()
Deprecated. 
Returns the double value of this FixedDecimal.

Returns:
the double value of this FixedDecimal

floatValue

public float floatValue()
Deprecated. 
Returns the float value of this FixedDecimal.

Returns:
the float value of this FixedDecimal

bigDecimalValue

public java.math.BigDecimal bigDecimalValue()
Deprecated. 
Return the BigDecimal value of this FixedDecimal.

Returns:
the BigDecimal value of this FixedDecimal

getLength

public int getLength()
Deprecated. 
Returns the total fixed length.

Returns:
the total fixed length

getDecimals

public int getDecimals()
Deprecated. 
Returns the decimals length

Returns:
the decimals length

equals

public boolean equals(java.lang.Object o)
Deprecated. 
Compares two Objects for equality.

Parameters:
o - the object to be compared to this object
Returns:
true if this object is the same as the argument; false otherwise

hashCode

public int hashCode()
Deprecated. 
Returns the hash code value of this FixedDecimal.
This value is equal to the sum of the following attributes:

Returns:
a hash code value of this FixedDecimal


Copyright © 2005 SAP AG. All Rights Reserved.