com.ibm.as400.access
Class PackedDecimalFieldDescription

java.lang.Object
  extended by com.ibm.as400.access.FieldDescription
      extended by com.ibm.as400.access.PackedDecimalFieldDescription
All Implemented Interfaces:
Serializable

public class PackedDecimalFieldDescription
extends FieldDescription
implements Serializable

The PackedDecimalFieldDescription class represents the description of the data in a packed decimal field. It allows:

Click hereto see an example.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 
Fields inherited from class com.ibm.as400.access.FieldDescription
ALIGN_LEFT, ALIGN_RIGHT
 
Constructor Summary
Constructor and Description
PackedDecimalFieldDescription()
          Constructs a PackedDecimalFieldDescription object.
PackedDecimalFieldDescription(AS400PackedDecimal dataType, String name)
          Constructs a PackedDecimalFieldDescription object.
PackedDecimalFieldDescription(AS400PackedDecimal dataType, String name, String ddsName)
          Constructs a PackedDecimalFieldDescription object.
 
Method Summary
Modifier and Type Method and Description
 int getDecimalPositions()
          Returns the number of digits after the decimal point for this field.
 void setDataType(AS400PackedDecimal dataType)
          Sets the AS400DataType object describing this field.
 void setDFT(BigDecimal defaultValue)
          Sets the value for the DFT keyword for this field.
 void setDFTNull()
          Sets the value for the DFT keyword to be *NULL for this field.
 
Methods inherited from class com.ibm.as400.access.FieldDescription
getALIAS, getALWNULL, getCOLHDG, getDataType, getDDSName, getDFT, getDFTCurrentValue, getFieldName, getKeyFieldFunctions, getLayoutAlignment, getLayoutLength, getLength, getREFFLD, getTEXT, isDFTCurrent, isDFTNull, setALIAS, setALWNULL, setCOLHDG, setDataType, setDDSName, setFieldName, setKeyFieldFunctions, setLayoutAlignment, setLayoutAttributes, setLayoutLength, setREFFLD, setTEXT
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackedDecimalFieldDescription

public PackedDecimalFieldDescription(AS400PackedDecimal dataType,
                                     String name)
Constructs a PackedDecimalFieldDescription object. It uses the specified data type and name of the field. The number of digits and the number of decimal positions will be determined from dataType.

Parameters:
dataType - Describes the field and provides the conversion capability for the contents of the field.
name - The name of the field.

PackedDecimalFieldDescription

public PackedDecimalFieldDescription()
Constructs a PackedDecimalFieldDescription object.


PackedDecimalFieldDescription

public PackedDecimalFieldDescription(AS400PackedDecimal dataType,
                                     String name,
                                     String ddsName)
Constructs a PackedDecimalFieldDescription object. It uses the specified data type, name, and DDS name of the field. The number of digits and the number of decimal positions will be determined from dataType.

Parameters:
dataType - Describes the field and provides the conversion capability for the contents of the field.
name - The name of the field.
ddsName - The DDS name of this field. This is the name of the field as it would appear in a DDS description of the field. The length of ddsName must be 10 characters or less.
Method Detail

getDecimalPositions

public int getDecimalPositions()
Returns the number of digits after the decimal point for this field.

Returns:
The number of digits after the decimal point.

setDataType

public void setDataType(AS400PackedDecimal dataType)
Sets the AS400DataType object describing this field.

Parameters:
dataType - The AS400DataType that describes this field. The dataType cannot be null.

setDFT

public void setDFT(BigDecimal defaultValue)
Sets the value for the DFT keyword for this field.

Parameters:
defaultValue - The default value for this field. The defaultValue cannot be null. To set a default value of *NULL, use the setDFTNull() method.

setDFTNull

public void setDFTNull()
Sets the value for the DFT keyword to be *NULL for this field. Calling this method will replace the DFT keyword that was previously set on a call to setDFT(). Note: This field must also have its ALWNULL keyword set to true to prevent DDS errors.