![]() | [using it] | Interface Manipulation Package v4.0 (2008-06-25) | ![]() | ©copyright | ![]() |
java.lang.Objectimp.core.Value
imp.core.Numeric
public class Numeric
Implements an arbitrary-precision signed numerical value.
$integer = ([-])?([0-9])?+ |
$hexadecimal-integer = [#]([0-9a-fA-F])?+ |
$float = $integer([.]$integer)?([eE]$integer)? |
Field Summary |
---|
Fields inherited from class imp.core.Value |
---|
NULL |
Method Summary | |
---|---|
Numeric |
add(Numeric value)
Returns a value equal to (this + value). |
static Numeric |
atan2(Numeric x,
Numeric y)
Converts approximately rectangular coordinates (x, y) to the polar phase theta. |
byte |
byteValue()
Returns the value of the specified number as a byte. |
int |
compareTo(Value value)
Compares this with the specified value. |
BigDecimal |
decimalValue()
Returns the value of the specified number as a big decimal. |
Numeric |
divide(Numeric value)
Returns a value equal to (this / value) using integer division. |
double |
doubleValue()
Returns the value of the specified number as a double. |
static double |
doubleValue(Value value,
double optionalDefaultValue)
Returns the value as a double. |
Numeric |
exp()
Returns a value approximately equals to exp(this), the Euler's number raised to the power of this. |
float |
floatValue()
Returns the value of the specified number as a float. |
BigDecimal |
getValue()
Gets this numeric value. |
BigInteger |
integerValue()
Returns the value of the specified number as a big integer. |
int |
intValue()
Returns the value of the specified number as an int. |
static int |
intValue(Value value,
int optionalDefaultValue)
Returns the value as an integer. |
Numeric |
inverse()
Returns a value equal to (1.0/this). |
Numeric |
log()
Returns a value approximately equals to log(this), the natural logarithm (base e). |
long |
longValue()
Returns the value of the specified number as a long. |
static long |
longValue(Value value,
long optionalDefaultValue)
Returns the value as a long. |
Numeric |
mul(Numeric value)
Returns a value equal to (this * value). |
Numeric |
negate()
Returns a value equal to (-this). |
static Numeric |
numberValue(Value value,
Numeric optionalDefaultValue)
Return the value as a number. |
Numeric |
pow(Numeric value)
Returns a value approximately equals to this^value. |
Numeric |
round()
Returns an integer value approximately equals to this. |
Numeric |
setValue(String value)
Sets this value (thus erase previous value) from the given string and return this. |
short |
shortValue()
Returns the value of the specified number as a short. |
Methods inherited from class imp.core.Value |
---|
add, create, elements, fields, get, getType, getWrapping, isName, length, load, main, save, set, toString, wrappedObject |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public final Numeric add(Numeric value)
public static final Numeric atan2(Numeric x, Numeric y)
public final byte byteValue()
public final int compareTo(Value value)
compareTo
in interface Comparable<Value>
value
- value to which this is to be compared, default is a number equal to 0.
public final BigDecimal decimalValue()
public final Numeric divide(Numeric value)
public final double doubleValue()
public static final double doubleValue(Value value, double optionalDefaultValue)
public final Numeric exp()
public final float floatValue()
public final BigDecimal getValue()
public final BigInteger integerValue()
public final int intValue()
public static final int intValue(Value value, int optionalDefaultValue)
public final Numeric inverse() throws ArithmeticException
ArithmeticException
- if this is zero.public final Numeric log()
public final long longValue()
public static final long longValue(Value value, long optionalDefaultValue)
public final Numeric mul(Numeric value)
public final Numeric negate()
public static final Numeric numberValue(Value value, Numeric optionalDefaultValue)
public final Numeric pow(Numeric value)
public final Numeric round()
public final Numeric setValue(String value)
value
- A string defining the present value. The java null value is not allowed. IllegalStateException
- if the value can not be set.
IllegalArgumentException
- if the value is not valid.public final short shortValue()