net.sf.cb2java.copybook.data
Class DecimalData

java.lang.Object
  extended bynet.sf.cb2java.copybook.data.Data
      extended bynet.sf.cb2java.copybook.data.ValueData
          extended bynet.sf.cb2java.copybook.data.NumericData
              extended bynet.sf.cb2java.copybook.data.DecimalData

public class DecimalData
extends NumericData


Field Summary
 java.math.BigDecimal data
           
 
Constructor Summary
DecimalData(Numeric definition)
           
 
Method Summary
 java.math.BigDecimal getBigDecimal()
           
 double getDouble()
           
 float getFloat()
           
 java.lang.Object getValue()
          returns the Object as it's 'natural' Java type
 void setRoundingMode(int mode)
           
 void setValue(java.math.BigDecimal data)
           
 void setValue(java.math.BigDecimal data, boolean validate)
           
 void setValue(double data)
          sets the value of this data object with the given floating point number.
protected  void setValueImpl(java.lang.Object data)
          called by setData after validate is called
 
Methods inherited from class net.sf.cb2java.copybook.data.NumericData
toString, translate
 
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
 

Field Detail

data

public java.math.BigDecimal data
Constructor Detail

DecimalData

public DecimalData(Numeric definition)
Method Detail

setRoundingMode

public void setRoundingMode(int mode)

getFloat

public float getFloat()

getDouble

public double getDouble()

getBigDecimal

public java.math.BigDecimal getBigDecimal()

setValue

public void setValue(double data)
sets the value of this data object with the given floating point number. Rounds the value to the decimalPlaces specified in the definiton using this object's rounding more.

Parameters:
data - the value to set this Object to

setValueImpl

protected void setValueImpl(java.lang.Object data)
Description copied from class: Data
called by setData after validate is called

Specified by:
setValueImpl in class Data
Parameters:
data - the data to set

setValue

public void setValue(java.math.BigDecimal data)

setValue

public void setValue(java.math.BigDecimal data,
                     boolean validate)

getValue

public java.lang.Object getValue()
Description copied from class: Data
returns the Object as it's 'natural' Java type

Specified by:
getValue in class Data