com.ibm.as400.access
Class FloatFieldDescription
- java.lang.Object
-
- com.ibm.as400.access.FieldDescription
-
- com.ibm.as400.access.FloatFieldDescription
-
- All Implemented Interfaces:
- java.io.Serializable
public class FloatFieldDescription extends FieldDescription implements java.io.Serializable
Represents the description of the data in a float field. It allows:- The user to describe a float field to the RecordFormat object.
- The RecordFormat object to describe a float field to the user.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.ibm.as400.access.FieldDescription
ALIGN_LEFT, ALIGN_RIGHT
-
-
Constructor Summary
Constructors Constructor and Description FloatFieldDescription()
Constructs a FloatFieldDescription object.FloatFieldDescription(AS400Float4 dataType, java.lang.String name)
Constructs a FloatFieldDescription object.FloatFieldDescription(AS400Float4 dataType, java.lang.String name, java.lang.String ddsName, int length)
Constructs a FloatFieldDescription object.FloatFieldDescription(AS400Float4 dataType, java.lang.String name, java.lang.String ddsName, int length, int decimalPositions)
Constructs a FloatFieldDescription object.FloatFieldDescription(AS400Float8 dataType, java.lang.String name)
Constructs a FloatFieldDescription object.FloatFieldDescription(AS400Float8 dataType, java.lang.String name, java.lang.String ddsName, int length)
Constructs a FloatFieldDescription object.FloatFieldDescription(AS400Float8 dataType, java.lang.String name, java.lang.String ddsName, int length, int decimalPositions)
Constructs a FloatFieldDescription object.
-
Method Summary
Methods Modifier and Type Method and Description int
getDecimalPositions()
Returns the number of digits after the decimal point for this field.java.lang.String
getFLTPCN()
Returns the value specified for the FLTPCN keyword for this field.void
setDataType(AS400Float4 dataType)
Sets the AS400DataType object describing this field.void
setDataType(AS400Float8 dataType)
Sets the AS400DataType object describing this field.void
setDecimalPositions(int decimalPositions)
Sets the number of digits after the decimal point for this field.void
setDFT(java.lang.Double defaultValue)
Sets the value for the DFT keyword for this field.void
setDFT(java.lang.Float 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.void
setFLTPCN(java.lang.String floatPrecision)
Sets the value for the FLTPCN keyword for this field.void
setLength(int length)
Sets the length of this field.-
Methods inherited from class com.ibm.as400.access.FieldDescription
getALIAS, getALWNULL, getCOLHDG, getDataType, getDDSName, getDFT, getDFTCurrentValue, getFieldName, getKeyFieldFunctions, getLayoutAlignment, getLayoutLength, getLength, getREFFIL, getREFFLD, getREFFMT, getREFLIB, getTEXT, isDFTCurrent, isDFTNull, setALIAS, setALWNULL, setCOLHDG, setDataType, setDDSName, setFieldName, setKeyFieldFunctions, setLayoutAlignment, setLayoutAttributes, setLayoutLength, setREFFIL, setREFFLD, setREFFMT, setREFLIB, setTEXT
-
-
-
-
Constructor Detail
-
FloatFieldDescription
public FloatFieldDescription()
Constructs a FloatFieldDescription object.
-
FloatFieldDescription
public FloatFieldDescription(AS400Float8 dataType, java.lang.String name)
Constructs a FloatFieldDescription object. It uses the specified data type and name of the field.- Parameters:
dataType
- Describes the field and provides the conversion capability for the contents of the field.name
- The name of the field.
-
FloatFieldDescription
public FloatFieldDescription(AS400Float8 dataType, java.lang.String name, java.lang.String ddsName, int length)
Constructs a FloatFieldDescription object. It uses the specified data type, name, DDS name, and length of the field.- 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.length
- The number of digits that the field will hold. This is the length of the field as it would appear in a DDS description. The length must be greater than zero.
-
FloatFieldDescription
public FloatFieldDescription(AS400Float8 dataType, java.lang.String name, java.lang.String ddsName, int length, int decimalPositions)
Constructs a FloatFieldDescription object. It uses the specified data type, name, DDS name, length and decimal positions of the field.- 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.length
- The number of digits that the field will hold. This is the length of the field as it would appear in a DDS description. The length must be greater than zero.decimalPositions
- The number of digits to the right of the decimal point. The decimalPositions cannot be negative.
-
FloatFieldDescription
public FloatFieldDescription(AS400Float4 dataType, java.lang.String name)
Constructs a FloatFieldDescription object. It uses the specified data type and name of the field.- Parameters:
dataType
- Describes the field and provides the conversion capability for the contents of the field.name
- The name of the field.
-
FloatFieldDescription
public FloatFieldDescription(AS400Float4 dataType, java.lang.String name, java.lang.String ddsName, int length)
Constructs a FloatFieldDescription object. It uses the specified data type, name, DDS name, and length of the field.- 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.length
- The number of digits that the field will hold. This is the length of the field as it would appear in a DDS description. The length must be greater than zero.
-
FloatFieldDescription
public FloatFieldDescription(AS400Float4 dataType, java.lang.String name, java.lang.String ddsName, int length, int decimalPositions)
Constructs a FloatFieldDescription object. It uses the specified data type, name, DDS name, length and decimal positions of the field.- 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.length
- The number of digits that the field will hold. This is the length of the field as it would appear in a DDS description. The length must be greater than zero.decimalPositions
- The number of digits to the right of the decimal point. The decimalPositions cannot be negative.
-
-
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.
-
getFLTPCN
public java.lang.String getFLTPCN()
Returns the value specified for the FLTPCN keyword for this field.- Returns:
- The value specified for FLTPCN for this field. Possible values are *SINGLE or *DOUBLE. If FLTPCN was not specified for this field, an empty string is returned.
-
setDataType
public void setDataType(AS400Float4 dataType)
Sets the AS400DataType object describing this field.- Parameters:
dataType
- The AS400DataType that describes this field. The dataType cannot be null.
-
setDataType
public void setDataType(AS400Float8 dataType)
Sets the AS400DataType object describing this field.- Parameters:
dataType
- The AS400DataType that describes this field. The dataType cannot be null.
-
setDecimalPositions
public void setDecimalPositions(int decimalPositions)
Sets the number of digits after the decimal point for this field.- Parameters:
decimalPositions
- The number of digits after the decimal point. The decimalPositions cannot be less than zero.
-
setFLTPCN
public void setFLTPCN(java.lang.String floatPrecision)
Sets the value for the FLTPCN keyword for this field.- Parameters:
floatPrecision
- The value to set for the FLTPCN keyword for this field. Possible values are *SINGLE or *DOUBLE. The floatPrecision cannot be null.
-
setDFT
public void setDFT(java.lang.Double defaultValue)
Sets the value for the DFT keyword for this field. Use this version of setDFT() when an AS400Float8 was used to construct the object.- Parameters:
defaultValue
- The default value for this field. The defaultValue cannot be null. To set a default value of *NULL, use the setDFTNull() method.
-
setDFT
public void setDFT(java.lang.Float defaultValue)
Sets the value for the DFT keyword for this field. Use this version of setDFT() when an AS400Float4 was used to construct the object.- 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.
-
setLength
public void setLength(int length)
Sets the length of this field.- Parameters:
length
- The length of this field. The length must be greater than zero.
-
-