| 
 | Oracle Fusion Middleware Java API Reference for Oracle Generic Domains 11g Release 1 (11.1.1.5.0) E10655-06 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
   oracle.jbo.domain.Number
oracle.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 NumberDomain object representing zero. | |
| Number(java.math.BigDecimal value)Creates a NumberDomain object from aBigDecimal. | |
| Number(java.math.BigInteger value)Creates a NumberDomain object from aBigInteger. | |
| Number(boolean value)Creates a NumberDomain object from aBoolean. | |
| Number(double value)Creates a NumberDomain object from andouble. | |
| Number(java.lang.Double value)Creates a NumberDomain object from anDoubleobject. | |
| Number(float value)Creates a NumberDomain object from anfloat. | |
| Number(int value)Creates a NumberDomain object from anint. | |
| Number(long value)Creates a NumberDomain object from anlong. | |
| Number(java.lang.Long value)Creates a NumberDomain object from anLongobject. | |
| Number(Number value)Creates a Numberidentical to an existingNumber. | |
| Number(java.lang.Object value)Creates a NumberDomain object from aBigInteger. | |
| Number(short value)Creates a NumberDomain object from anshort. | |
| Number(java.lang.String value)Creates a NumberDomain object from a JavaString. | |
| Number(java.lang.String value, int precision)Creates a NumberDomain object from a JavaString. | |
| 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 thisfor 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 thisto anObject. | 
|  java.lang.Number | getDataAsJavaNumber()Converts thisto anObject. | 
|  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 thisby 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 thisto 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.SQLExceptionpublic 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 - ...SQLExceptionpublic 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| 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.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()
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.KeyAttributeInterfacepublic 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.5.0) E10655-06 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||