|
Oracle Fusion Middleware Java API Reference for Oracle Generic Domains 11g Release 1 (11.1.1.4.0) E10655-05 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jbo.domain.Number
public class Number
This class provides a lightweight wrapper for 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 Summary | |
---|---|
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 . |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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.
SQLException
- on over/underflow of the exponent
or on overflow of the mantissa.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
- ...
SQLException
- on overflow.public Number(java.lang.String value)
Number
Domain object from a
Java String
.
value
- a textual representation of a BigDecimal
.
java.sql.SQLException
- on over/underflow of the exponent
or on overflow of the mantissa, or if the string does not represent a
valid number.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.
SQLException
- never.Method Detail |
---|
public int getPrecision()
public java.lang.Number getDataAsJavaNumber()
this
to an Object
.
public java.math.BigDecimal getBigDecimalValue()
public double getValue()
public java.lang.Object getData()
this
to an Object
.
getData
in interface oracle.jbo.domain.DomainInterface
public void setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx)
setContext
in interface oracle.jbo.domain.DomainInterface
public 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.Object
public boolean equals(java.lang.Object other)
this
for equality with another object.
equals
in class java.lang.Object
other
- an arbitrary Object
.
true
if conversion was successful and the converted
argument is identical to this
.public int hashCode()
hashCode
in class java.lang.Object
this
.protected void validate()
public int compareTo(double n)
n
- input Oracle Number
public int compareTo(Number n)
n
- input Oracle Number
public Number multiply(Number n)
this
by another number.
n
- a number.
Number
object.public double doubleValue()
public float floatValue()
public long longValue()
java.sql.SQLException
- if the Oracle Number
exponent is out of range.public int intValue()
java.sql.SQLException
- if the Oracle Number
exponent is out of range.public short shortValue()
java.sql.SQLException
- if the Oracle Number
exponent is out of range.public byte byteValue()
java.sql.SQLException
- if the Oracle Number
exponent is out of range.public java.math.BigInteger bigIntegerValue()
java.sql.SQLException
- if the Oracle Number exponent is out of range.public java.math.BigDecimal bigDecimalValue()
java.sql.SQLException
- on over/underflow of the Oracle Number exponent
and on overflow of the mantissa.public java.lang.String stringValue()
public boolean booleanValue()
public byte[] getBytes()
getBytes
in interface oracle.jbo.domain.KeyAttributeInterface
public void setBytes(byte[] bArr)
setBytes
in interface oracle.jbo.domain.KeyAttributeInterface
|
Oracle Fusion Middleware Java API Reference for Oracle Generic Domains 11g Release 1 (11.1.1.4.0) E10655-05 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |