|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.math.Number
ewe.math.BigDecimal
| Field Summary | |
static int |
ROUND_CEILING
|
static int |
ROUND_DOWN
|
static int |
ROUND_FLOOR
|
static int |
ROUND_HALF_DOWN
|
static int |
ROUND_HALF_EVEN
|
static int |
ROUND_HALF_UP
|
static int |
ROUND_UNNECESSARY
|
static int |
ROUND_UP
|
| Fields inherited from class ewe.math.Number |
DOUBLE_MAX_VALUE, DOUBLE_MIN_VALUE, INTEGER_MAX_VALUE, INTEGER_MIN_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE, NEGATIVE_INFINITY, POSITIVE_INFINITY |
| Constructor Summary | |
BigDecimal(BigInteger num)
|
|
BigDecimal(BigInteger num,
int scale)
|
|
BigDecimal(byte[] data)
|
|
BigDecimal(byte[] data,
int offset,
int length)
Create a new BigDecimal from a byte array. |
|
BigDecimal(double num)
|
|
BigDecimal(String num)
|
|
| Method Summary | |
BigDecimal |
abs()
|
BigDecimal |
add(BigDecimal val)
|
static int |
compareEncoded(byte[] one,
int oneOffset,
int oneLen,
byte[] two,
int twoOffset,
int twoLen)
|
int |
compareTo(BigDecimal val)
|
int |
compareTo(Object val)
Compare this object with another. |
BigDecimal |
divide(BigDecimal val,
int roundingMode)
|
BigDecimal |
divide(BigDecimal val,
int newScale,
int roundingMode)
|
double |
doubleValue()
Return the value of this Number as a double. |
int |
encodeBytes(ByteArray dest)
This requests the Object to encode itself as a stream of bytes which is appended to the destination ByteArray. |
boolean |
equals(Object o)
Returns if this object is considered equal to the other object. |
float |
floatValue()
Return the value of this Number as a float. |
int |
hashCode()
Returns a hashCode for the object. |
int |
intValue()
Return the value of this Number as an int. |
long |
longValue()
Return the value of this Number as a long. |
BigDecimal |
max(BigDecimal val)
|
BigDecimal |
min(BigDecimal val)
|
BigDecimal |
movePointLeft(int n)
|
BigDecimal |
movePointRight(int n)
|
BigDecimal |
multiply(BigDecimal val)
|
BigDecimal |
negate()
|
int |
scale()
|
BigDecimal |
setScale(int scale)
|
BigDecimal |
setScale(int scale,
int roundingMode)
|
int |
signum()
|
BigDecimal |
subtract(BigDecimal val)
|
BigInteger |
toBigInteger()
|
byte[] |
toByteArray()
|
String |
toString()
Return a String representation of this object. |
BigInteger |
unscaledValue()
|
static BigDecimal |
valueOf(long val)
|
static BigDecimal |
valueOf(long val,
int scale)
|
int |
write(byte[] data,
int offset)
Write the BigDecimal as a series of bytes, or find out how many bytes are needed for storing the BigDecimal. |
| Methods inherited from class ewe.math.Number |
byteValue, digit, forDigit, isInfinite, isNaN, shortValue |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass |
| Field Detail |
public static final int ROUND_UP
public static final int ROUND_DOWN
public static final int ROUND_CEILING
public static final int ROUND_FLOOR
public static final int ROUND_HALF_UP
public static final int ROUND_HALF_DOWN
public static final int ROUND_HALF_EVEN
public static final int ROUND_UNNECESSARY
| Constructor Detail |
public BigDecimal(BigInteger num)
public BigDecimal(BigInteger num,
int scale)
throws NumberFormatException
public BigDecimal(double num)
throws NumberFormatException
public BigDecimal(String num)
throws NumberFormatException
public BigDecimal(byte[] data,
int offset,
int length)
data - the data to read.offset - the start of the data.length - the number of bytes of encoded data.public BigDecimal(byte[] data)
| Method Detail |
public static BigDecimal valueOf(long val)
public static BigDecimal valueOf(long val,
int scale)
throws NumberFormatException
NumberFormatExceptionpublic BigDecimal add(BigDecimal val)
public BigDecimal subtract(BigDecimal val)
public BigDecimal multiply(BigDecimal val)
public BigDecimal divide(BigDecimal val,
int roundingMode)
throws ArithmeticException,
IllegalArgumentException
ArithmeticException
IllegalArgumentException
public BigDecimal divide(BigDecimal val,
int newScale,
int roundingMode)
throws ArithmeticException,
IllegalArgumentException
ArithmeticException
IllegalArgumentExceptionpublic int compareTo(BigDecimal val)
public int compareTo(Object val)
Comparable
compareTo in interface Comparablepublic boolean equals(Object o)
Object
equals in class Objecto - Another object to compare to.
public int hashCode()
Object
hashCode in class Objectpublic BigDecimal max(BigDecimal val)
public BigDecimal min(BigDecimal val)
public BigDecimal movePointLeft(int n)
public BigDecimal movePointRight(int n)
public int signum()
public int scale()
public BigInteger unscaledValue()
public BigDecimal abs()
public BigDecimal negate()
public String toString()
Object
toString in class Objectpublic BigInteger toBigInteger()
public int intValue()
NumberNumber as an int.
intValue in class Numberpublic long longValue()
NumberNumber as a long.
longValue in class Numberpublic float floatValue()
NumberNumber as a float.
floatValue in class Numberpublic double doubleValue()
NumberNumber as a double.
doubleValue in class Number
public BigDecimal setScale(int scale)
throws ArithmeticException
ArithmeticException
public BigDecimal setScale(int scale,
int roundingMode)
throws ArithmeticException,
IllegalArgumentException
ArithmeticException
IllegalArgumentException
public int write(byte[] data,
int offset)
data - The destination byte array or null to find out how many bytes are needed.offset - The offset in the byte array to write to.
public int encodeBytes(ByteArray dest)
ByteEncodable
encodeBytes in interface ByteEncodabledest - The destination ByteArray, or null to determine the number of bytes needed to encode.
public byte[] toByteArray()
public static int compareEncoded(byte[] one,
int oneOffset,
int oneLen,
byte[] two,
int twoOffset,
int twoLen)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||