public class Number
extends java.lang.Object
implements oracle.jbo.domain.DomainInterface, java.io.Serializable, oracle.jbo.domain.KeyAttributeInterface
java.lang.Number,
the native Java type for number objects. This wrapper allows an instance
of the java.lang.Number to be used as a domain object.
The intent of many of the methods in this class is to wrap the corresponding
method in the java.lang.Number class such that it returns
an instance of an oracle.jbo.domain.Number object.
Number objects consist of data (a byte array)
and a Domain type code.
Domain numbers extend SQL characters by being convertable to
JDBC values.
| Constructor and Description |
|---|
Number()
Creates a
Number Domain object representing zero. |
Number(java.math.BigDecimal value)
Creates a
Number Domain object from a
BigDecimal. |
Number(java.math.BigInteger value)
Creates a
Number Domain object from a
BigInteger. |
Number(boolean value)
Creates a
Number Domain object from a Boolean. |
Number(double value)
Creates a
Number Domain object from an double. |
Number(java.lang.Double value)
Creates a
Number Domain object from an Double object. |
Number(float value)
Creates a
Number Domain object from an float. |
Number(int value)
Creates a
Number Domain object from an int. |
Number(long value)
Creates a
Number Domain object from an long. |
Number(java.lang.Long value)
Creates a
Number Domain object from an Long object. |
Number(Number value)
Creates a
Number identical to an
existing Number. |
Number(java.lang.Object value)
Creates a
Number Domain object from a
BigInteger. |
Number(short value)
Creates a
Number Domain object from an short. |
Number(java.lang.String value)
Creates a
Number Domain object from a
Java String. |
Number(java.lang.String value,
int precision)
Creates a
Number Domain object from a
Java String. |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigDecimal |
bigDecimalValue()
Calls toBigDecimal to convert internal Oracle Number into a Java
BigDecimal.
|
java.math.BigInteger |
bigIntegerValue() |
boolean |
booleanValue()
Calls toBoolean to convert internal Oracle Number to a Java boolean.
|
byte |
byteValue()
Calls toByte to convert internal Oracle Number to a Java byte.
|
int |
compareTo(double n)
Returns -1 if NUMBER is less than n, 0 if NUMBER and n are equal (==),
1 if NUMBER is greater than n.
|
int |
compareTo(Number n)
Returns -1 if NUMBER is less than n, 0 if NUMBER and n are equal (==),
1 if NUMBER is greater than n.
|
double |
doubleValue()
Calls toDouble to convert internal Oracle Number to a Java double.
|
boolean |
equals(java.lang.Object other)
Tests
this for equality with another object. |
float |
floatValue()
Calls toFloat to convert internal Oracle Number to a Java float.
|
java.math.BigDecimal |
getBigDecimalValue()
Return a this domain's value as BigDecimal
This method may be used to access the value for this domain in EL-expressions.
|
byte[] |
getBytes() |
java.lang.Object |
getData()
Converts
this to an Object. |
java.lang.Number |
getDataAsJavaNumber()
Converts
this to an Object. |
int |
getPrecision() |
double |
getValue()
Return a this domain's value as double
This method may be used to access the value for this domain in EL-expressions.
|
int |
hashCode()
Computes the hash code.
|
int |
intValue()
Calls toInt to convert internal Oracle Number to a Java int.
|
long |
longValue()
Calls toLong to convert internal Oracle Number to a Java long.
|
Number |
multiply(Number n)
Multiplies
this by another number. |
void |
setBytes(byte[] bArr) |
void |
setContext(oracle.jbo.domain.DomainOwnerInterface owner,
oracle.jbo.Transaction trans,
java.lang.Object ctx) |
short |
shortValue()
Calls toShort to convert internal Oracle Number to a Java short.
|
java.lang.String |
stringValue()
Calls toString to convert internal Oracle Number to a Java String.
|
java.lang.String |
toString()
Converts
this to a fixed-point number presented as a string. |
static java.lang.String |
trimStr(java.lang.String s) |
protected void |
validate()
Implements domain validation logic and throws a JboException on error.
|
public Number()
Number Domain object representing zero.
Use one of the NullValue() constructors to create
a null Number object.public Number(int value)
Number Domain object from an int.value - a 32-bit signed integer.public Number(java.lang.Long value)
Number Domain object from an Long object.value - a 64-bit signed integer.public Number(long value)
Number Domain object from an long.value - a 64-bit signed integer.public Number(short value)
Number Domain object from an short.value - a 16-bit signed integer.public Number(float value)
Number Domain object from an float.value - a 32-bit floating-point value.public Number(java.lang.Double value)
Number Domain object from an Double object.value - a 64-bit floating-point value.public Number(double value)
Number Domain object from an double.value - a 64-bit floating-point value.public Number(java.math.BigDecimal value)
Number Domain object from a
BigDecimal.public Number(java.math.BigInteger value)
Number Domain object from a
BigInteger.value - an arbitrarily integer.public Number(java.lang.Object value)
Number Domain object from a
BigInteger.value - an arbitrarily integer.public Number(java.lang.String value,
int precision)
Number Domain object from a
Java String.value - a textual representation of a fixed-point number.precision - ...public Number(java.lang.String value)
Number Domain object from a
Java String.value - a textual representation of a BigDecimal.public Number(boolean value)
Number Domain object from a Boolean.value - true or false.
The new instance of Number is 0 if value is false,
or 1 otherwise.public Number(Number value)
Number identical to an
existing Number.value - a Number Domain object.public int getPrecision()
public java.lang.Number getDataAsJavaNumber()
this to an Object.this converted to BigDecimalObjectpublic java.math.BigDecimal getBigDecimalValue()
public double getValue()
public java.lang.Object getData()
this to an Object.getData in interface oracle.jbo.domain.DomainInterfacethis converted to java.lang.NumberObjectpublic void setContext(oracle.jbo.domain.DomainOwnerInterface owner,
oracle.jbo.Transaction trans,
java.lang.Object ctx)
setContext in interface oracle.jbo.domain.DomainInterfacepublic static java.lang.String trimStr(java.lang.String s)
public java.lang.String toString()
this to a fixed-point number presented as a string.toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
this for equality with another object.equals in class java.lang.Objectother - an arbitrary Object.true if conversion was successful and the converted
argument is identical to this.public int hashCode()
hashCode in class java.lang.Objectthis.protected void validate()
public int compareTo(double n)
n - input Oracle Numberpublic int compareTo(Number n)
n - input Oracle Numberpublic Number multiply(Number n)
this by another number.n - a number.Number object.public double doubleValue()
public float floatValue()
public long longValue()
public int intValue()
public short shortValue()
public byte byteValue()
public java.math.BigInteger bigIntegerValue()
public java.math.BigDecimal bigDecimalValue()
public java.lang.String stringValue()
public boolean booleanValue()
public byte[] getBytes()
getBytes in interface oracle.jbo.domain.KeyAttributeInterfacepublic void setBytes(byte[] bArr)
setBytes in interface oracle.jbo.domain.KeyAttributeInterface