|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Classes implementing IAtomic are the types used in XMA to represent atomic values
both at the client and at the server side.
To facilitate transport over the network, this
type has a type (from Types) and
a String encoded atomic value.
The typed values which are held by this are string encoded.
The encodings are as follows:
TYPE ENCODING --------------------------------------------------------------------------------------- T_BOOLEAN "J" or "N" T_STRING the string itself T_BCD canonic string format of ABcd, see ABcd.toString(). Example: -12000.32 T_DATE canonic string format of ADate yyyyMMdd, see ADate.toString() T_TIMESTAMP encoding as defined inAn Atom may be created from and converted to the most JDK supplied types. The following table lists the conversions:TimeStampUtil. T_DOM key of the domain value, seeat.spardat.xma.datasource.ADomX.
TYPE may be converted to, may be constructed from --------------------------------------------------------------------------------------- T_BOOLEAN Boolean T_STRING String T_BCD Double, Integer T_DATE java.util.Date T_TIMESTAMP java.sql.Timestamp
| Method Summary | |
java.lang.String |
getEncodedValue()
Returns the String encoded value of this. |
byte |
getType()
Returns the type constant. |
boolean |
hasValue()
Returns true if this Atom holds a value. |
boolean |
isTrue()
Returns true if getType() equals T_BOOLEAN and the stored value equals TRUE. |
java.math.BigDecimal |
toBigDecimal()
If the type of this is T_BCD, the numeric value is returned as a BigDecimal. |
byte |
toByte()
Returns the value of this as byte. |
java.lang.Byte |
toBYTE()
Returns the value of this as Byte or null if ! |
java.util.Date |
toDate()
Returns a newly constructed java.util.Date object representing the value of this. |
double |
toDouble()
Extracts a double from this. |
java.lang.Double |
toDOUBLE()
Returns the value of this as Double or null if ! |
float |
toFloat()
Extracts a float from this. |
java.lang.Float |
toFLOAT()
Returns the value of this as Float or null if ! |
int |
toInt()
Returns the value of this as int. |
java.lang.Integer |
toINTEGER()
Returns the value of this as Integer or null if ! |
long |
toLong()
Returns the value of this as long. |
java.lang.Long |
toLONG()
Returns the value of this as Long or null if ! |
short |
toShort()
Returns the value of this as short. |
java.lang.Short |
toSHORT()
Returns the value of this as Short or null if ! |
java.lang.String |
toString()
Returns a String representing the value of this. |
java.lang.String |
toString(at.spardat.enterprise.fmt.IFmt formatter)
Maps this Atom to string representation using a IFmt object. |
| Method Detail |
public boolean hasValue()
public byte getType()
public java.lang.String toString(at.spardat.enterprise.fmt.IFmt formatter)
formatter - the IFmt formatter. May be null.
public java.lang.String toString()
T_BOOLEAN "J" or "N"
T_STRING the string itself
T_BCD -12000.32
T_DATE yyyyMMdd
example: 20001231, the last day in the year 2000
T_TIMESTAMP yyyyMMdd HH:mm:ss.SSS z
example: 20001231 23:59:59.999 CET denoting the last millisecond in the year 2000, central european time.
T_DOM key of the domain value
The empty string is returned if this does not store a value.
public double toDouble()
java.lang.NumberFormatException - if this does not fit into a double.public float toFloat()
java.lang.NumberFormatException - if this does not fit into a float.public int toInt()
java.lang.NumberFormatException - if this does not fit into an intpublic long toLong()
java.lang.NumberFormatException - if this does not fit into an longpublic byte toByte()
java.lang.NumberFormatException - if this does not fit into an bytepublic short toShort()
java.lang.NumberFormatException - if this does not fit into a shortpublic java.util.Date toDate()
public boolean isTrue()
public java.math.BigDecimal toBigDecimal()
public java.lang.String getEncodedValue()
public java.lang.Byte toBYTE()
java.lang.RuntimeException - if the value stored in this does not fit into a Byte.public java.lang.Short toSHORT()
java.lang.RuntimeException - if the value stored in this does not fit into a Short.public java.lang.Integer toINTEGER()
java.lang.RuntimeException - if the value stored in this does not fit into a Integer.public java.lang.Long toLONG()
java.lang.RuntimeException - if the value stored in this does not fit into a Long.public java.lang.Float toFLOAT()
public java.lang.Double toDOUBLE()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||