public class Numeric extends Number implements Cloneable, Comparable<Numeric>
| Constructor and Description |
|---|
Numeric()
Deprecated.
(missing javadoc)
|
Numeric(BigDecimal d)
Deprecated.
(missing javadoc)
|
Numeric(BigDecimal d,
int scale)
Create a new
Numeric with given value and scale. |
Numeric(long l)
Deprecated.
(missing javadoc)
|
Numeric(long l,
int scale)
Create a new
Numeric with given value and scale. |
Numeric(Numeric n)
Deprecated.
(missing javadoc)
|
Numeric(Numeric n,
int scale)
Create a new
Numeric with given value and scale. |
Numeric(String s)
Deprecated.
(missing javadoc)
|
Numeric(String s,
int scale)
Create a new
Numeric with given value and scale. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long l)
Add the given
long value to this. |
void |
add(Numeric n)
Add the given
Numeric value to this. |
byte |
byteValue() |
Object |
clone()
Creates a copy of this object.
|
int |
compareTo(long l)
Compare this to the given
long value, using
BigDecimal.compareTo(). |
int |
compareTo(Numeric ob)
Compare this to the given
Object, using
BigDecimal.compareTo(). |
void |
divide(long l)
Divide this with the given
long value. |
void |
divide(Numeric n)
Divide this with the given
Numeric value. |
double |
doubleValue() |
boolean |
equals(BigDecimal d)
Compare this to the given
BigDecimal value, using
BigDecimal.equals(). |
boolean |
equals(Numeric n)
Compare this to the given
Numeric value, using
BigDecimal.equals(). |
boolean |
equals(Object that)
Compare this to the given
Object, using
BigDecimal.equals(). |
float |
floatValue() |
int |
getAsInt100()
Return the
BigDecimal as an int where its value is
multiplied with 100. |
static int |
getDefaultScale() |
double |
getDoubleValue()
Deprecated.
(missing javadoc)
|
int |
getIntValue()
Deprecated.
(missing javadoc)
|
long |
getLongValue()
Deprecated.
(missing javadoc)
|
int |
getScale()
Get scale for this Numeric
|
BigDecimal |
getValue()
Return the
BigDecimal value. |
int |
hashCode() |
int |
intValue() |
long |
longValue() |
Numeric |
makeCopy()
Deprecated.
(missing javadoc)
|
void |
multiply(long l)
Multiply the given
long value with this. |
void |
multiply(Numeric n)
Multiply the given
Numeric value with this. |
void |
multiplyPercent(int i)
Multiplies this numeric with the percent given in
n: <this
numeric> * n / 100. |
void |
negate()
Negate this value
|
void |
round()
Rounds the value with BigDecimal.ROUND_HALF_UP, precision of 0.
|
void |
roundFives()
Rounds the value by five
|
void |
roundTens()
Rounds the value by ten
|
static void |
setDefaultScale(int scale)
Sets the default scale
|
void |
setValue(BigDecimal value)
Set a new
BigDecimal as the value. |
short |
shortValue() |
void |
subtract(long l)
Subtract the given
long value from this. |
void |
subtract(Numeric n)
Subtract the given
Numeric value from this. |
String |
toString() |
String |
toStringWithoutDecimalPoint()
Return the unscaled value as a
String. |
@Deprecated public Numeric()
Numeric with zero value and default scale.@Deprecated public Numeric(Numeric n)
Numeric with given value and default scale.n - The Numeric value to copy.@Deprecated public Numeric(long l)
Numeric with given value and default scale.l - The long value to set.@Deprecated public Numeric(String s)
Numeric with given value and default scale.s - A String containing the value to set.@Deprecated public Numeric(BigDecimal d)
Numeric with given value and default scale.d - A BigDecimal with the value to set.public Numeric(Numeric n, int scale)
Numeric with given value and scale.n - The Numeric value to copy.scale - The scale.public Numeric(long l,
int scale)
Numeric with given value and scale.l - The long value to set.scale - The scale.public Numeric(String s, int scale)
Numeric with given value and scale.s - A String containing the value to set.scale - The scale.public Numeric(BigDecimal d, int scale)
Numeric with given value and scale.d - A BigDecimal with the value to set.scale - The scale.public int getScale()
public void add(Numeric n)
Numeric value to this.n - Numeric operand.public void add(long l)
long value to this.l - long operand.public void subtract(Numeric n)
Numeric value from this.n - Numeric operand.public void subtract(long l)
long value from this.l - long operand.public void multiply(Numeric n)
Numeric value with this.n - Numeric operand.public void multiply(long l)
long value with this.l - long operand.public void multiplyPercent(int i)
n: <this
numeric> * n / 100. The division part of this calculation is done with
precision of 2.i - Percent.public void divide(Numeric n)
Numeric value.n - Numeric operand.public void divide(long l)
long value.l - long operand.public void round()
public void roundFives()
public void roundTens()
@Deprecated public long getLongValue()
BigDecimal value as an long.@Deprecated public int getIntValue()
BigDecimal value as a int.public int getAsInt100()
BigDecimal as an int where its value is
multiplied with 100.@Deprecated public double getDoubleValue()
BigDecimal value as a double.public String toStringWithoutDecimalPoint()
String.String.@Deprecated public Numeric makeCopy()
public void setValue(BigDecimal value)
BigDecimal as the value. The previous scale is
preserved.value - The new value.public BigDecimal getValue()
BigDecimal value.public int compareTo(long l)
long value, using
BigDecimal.compareTo().l - value to compare.public int compareTo(Numeric ob)
Object, using
BigDecimal.compareTo().compareTo in interface Comparable<Numeric>ob - object to compare.Numeric.public boolean equals(Numeric n)
Numeric value, using
BigDecimal.equals().n - value to compare.public boolean equals(BigDecimal d)
BigDecimal value, using
BigDecimal.equals().d - value to compare.public boolean equals(Object that)
Object, using
BigDecimal.equals().public static int getDefaultScale()
defaultScale property.public static void setDefaultScale(int scale)
scale - the new default scalepublic void negate()
public double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic short shortValue()
shortValue in class Numberpublic Object clone()
clone in class ObjectObject.clone()Copyright © 2006–2020 Esito AS. All rights reserved.