|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.cb2java.copybook.data.Data
net.sf.cb2java.copybook.data.ValueData
net.sf.cb2java.copybook.data.FloatingData
Floating point representations are hardware specific so the precision that is supported by the underlying type may vary from platform to platform. For most normal uses Java floats or doubles should be safe to use but it's possible that there may be a loss of precision if the underlying platform does not follow the IEEE 754 spec.
Because not all floating types are the same in COBOL BigDecimal is the 'natural' type for this class, however, numbers with fraction portions that are not representable in binary will be rounded on setting the data.
| Constructor Summary | |
FloatingData(Floating definition)
constructor |
|
| Method Summary | |
java.math.BigDecimal |
getBigDecimal()
gets the big decimal representation of the value |
protected double |
getDouble()
returns the internal data as a BigDecimal |
protected float |
getFloat()
returns the internal data as a BigDecimal |
java.lang.Object |
getValue()
returns the internal data as a BigDecimal |
void |
setValue(java.math.BigDecimal data)
|
void |
setValueImpl(java.lang.Object data)
called by setData after validate is called |
java.lang.String |
toString()
|
protected java.lang.Object |
translate(java.lang.String data)
Converts the String to the underlying Data type's 'natural' type. |
| Methods inherited from class net.sf.cb2java.copybook.data.ValueData |
getChildren, isLeaf, toString |
| Methods inherited from class net.sf.cb2java.copybook.data.Data |
getDefinition, getName, setValue, setValue, validate, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FloatingData(Floating definition)
definition - the underlying definition for the
type in the copybook defintion| Method Detail |
public java.math.BigDecimal getBigDecimal()
public void setValueImpl(java.lang.Object data)
Data
setValueImpl in class Datadata - the data to setpublic void setValue(java.math.BigDecimal data)
public java.lang.String toString()
toString in class ValueDatapublic java.lang.Object getValue()
getValue in class Dataprotected float getFloat()
protected double getDouble()
protected java.lang.Object translate(java.lang.String data)
Data
translate in class Datadata - the string to use to set this data's value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||