com.ibm.as400.access

Class BinaryFieldDescription

  • All Implemented Interfaces:
    java.io.Serializable


    public class BinaryFieldDescription
    extends FieldDescription
    implements java.io.Serializable
    Represents the description of the data in a binary (integer) field. This class allows:
    • The user to describe a binary field to the RecordFormat object.
    • The RecordFormat object to describe a binary field to the user.
    Click hereto see an example.

    As of OS/400 V4R5, DDS supports up to 8-byte (18-digit) binary field descriptions. Using any of the data types that result in a byte length greater than 4 or a number of digits greater than 9 on a release prior to V4R5 may give unexpected results.

    See Also:
    Serialized Form
    • Constructor Detail

      • BinaryFieldDescription

        public BinaryFieldDescription()
        Constructs a BinaryFieldDescription object.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin4 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 9. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. The maximum number of digits allowed for a binary field by DDS is 18.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin4 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin4 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 9. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. The maximum number of digits allowed for a binary field by DDS is 18.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin4 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin8 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 18. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. The maximum number of digits allowed for a binary field by DDS is 18.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin8 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin8 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 18. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. The maximum number of digits allowed for a binary field by DDS is 18.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin8 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin2 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 4. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. Four (4) is the maximum number of digits allowed for a binary field (when represented by a bin2) by DDS.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin2 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin2 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 4. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. Four (4) is the maximum number of digits allowed for a binary field (when represented by a bin2) by DDS.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin2 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin1 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 3. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. Three (3) is the maximum number of digits allowed for a binary field (when represented by a bin1) by DDS.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400Bin1 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin1 dataType,
                              java.lang.String name)
        Constructs a BinaryFieldDescription object. It uses the specified data type and name of the field. The length of this field is represented by the number of digits it can contain. This constructor defaults the length (as returned by getLength()) to 3. The length is used by the Record Level Access classes when creating a file from a RecordFormat object. Three (3) is the maximum number of digits allowed for a binary field (when represented by a bin1) by DDS.
        Parameters:
        dataType - Describes the field and provides the conversion capability for the contents of the field.
        name - The name of the field.
      • BinaryFieldDescription

        public BinaryFieldDescription(AS400UnsignedBin1 dataType,
                              java.lang.String name,
                              java.lang.String ddsName,
                              int length)
        Constructs a BinaryFieldDescription object. It uses the specified data type, name, DDS name, and length of the field. This constructor is used when the field description will be used with the record level access classes.
        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 0.
    • Method Detail

      • setDataType

        public void setDataType(AS400Bin1 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(AS400UnsignedBin1 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(AS400Bin2 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(AS400UnsignedBin2 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(AS400Bin4 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(AS400UnsignedBin4 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(AS400Bin8 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(AS400UnsignedBin8 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(java.lang.Integer defaultValue)
        Sets the value for the DFT keyword for this field. Use this version of setDFT() when an AS400Bin4 or AS400UnsignedBin2 object was used to construct the object.
        Parameters:
        defaultValue - The default value for this field. The defaultValuecannot be null. To set a default value of *NULL, use the setDFTNull() method.
      • setDFT

        public void setDFT(java.math.BigInteger defaultValue)
        Sets the value for the DFT keyword for this field. Use this version of setDFT() when an UnsignedAS400Bin8 object was used to construct the object.
        Parameters:
        defaultValue - The default value for this field. The defaultValuecannot be null. To set a default value of *NULL, use the setDFTNull() method.
      • setDFT

        public void setDFT(java.lang.Long defaultValue)
        Sets the value for the DFT keyword for this field. Use this version of setDFT() when an AS400UnsignedBin4 or AS400Bin8 object was used to construct the object.
        Parameters:
        defaultValue - The default value for this field. The defaultValuecannot be null. To set a default value of *NULL, use the setDFTNull() method.
      • setDFT

        public void setDFT(java.lang.Short defaultValue)
        Sets the value for the DFT keyword for this field. Use this version of setDFT() when an AS400UnsignedBin1 or AS400Bin2 object was used to construct the object.
        Parameters:
        defaultValue - The default value for this field. The defaultValuecannot be null. To set a default value of *NULL, use the setDFTNull() method.
      • setDFT

        public void setDFT(java.lang.Byte defaultValue)
        Sets the value for the DFT keyword for this field. Use this version of setDFT() when an AS400Bin1 object was used to construct the object.
        Parameters:
        defaultValue - The default value for this field. The defaultValuecannot 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.