Module ibm.jzos

Class CobolDatatypeFactory

java.lang.Object
com.ibm.jzos.fields.DatatypeFactory
com.ibm.jzos.fields.CobolDatatypeFactory

public class CobolDatatypeFactory extends DatatypeFactory
Concrete implementation of DatatypeFactory with COBOL Field related factory methods.

Instances of this class or its subclasses will automatically construct instances of com.ibm.jzos.fields.daa classes if the com.ibm.jzos.fields.daa package is available at runtime. See DatatypeFactory for more information.

Since:
2.1.0, 2.4.5 Data Access Accelerator support
See Also:
  • Constructor Details

    • CobolDatatypeFactory

      public CobolDatatypeFactory()
  • Method Details

    • getBinaryAsLongField

      public BinaryAsLongField getBinaryAsLongField(int precision, boolean signed)
      Construct and return a BinaryAsLongField, advancing the current offset by its byte length.

      Note that the field behaves as if TRUNC(BIN) was set in COBOL.

      Overrides:
      getBinaryAsLongField in class DatatypeFactory
      Parameters:
      precision - the number of decimal digits of precision
      signed - true if the value is signed
      Returns:
      BinaryAsLongField
      See Also:
    • getBinaryAsIntField

      public BinaryAsIntField getBinaryAsIntField(int precision, boolean signed)
      Construct and return a BinaryAsIntField, advancing the current offset by its byte length.

      Note that the field behaves as if TRUNC(BIN) was set in COBOL.

      Overrides:
      getBinaryAsIntField in class DatatypeFactory
      Parameters:
      precision - the number of decimal digits of precision
      signed - true if the value is signed
      Returns:
      BinaryAsIntField
      See Also:
    • getBinaryAsBigDecimalField

      public BinaryAsBigDecimalField getBinaryAsBigDecimalField(int precision, int scale, boolean signed)
      Construct and return a BinaryAsBigDecimalField, advancing the current offset by its byte length.

      Note that the field behaves as if TRUNC(BIN) was set in COBOL.

      Overrides:
      getBinaryAsBigDecimalField in class DatatypeFactory
      Parameters:
      precision - the number of decimal digits of precision
      scale - the number of implied decimal digits in the fractional part of the field
      signed - true if the value is signed
      Returns:
      BinaryAsBigDecimalField
    • getBinaryAsBigIntegerField

      public BinaryAsBigIntegerField getBinaryAsBigIntegerField(int precision, int scale, boolean signed)
      Construct and return a BinaryAsBigIntegerField, advancing the current offset by its byte length.

      Note that the field behaves as if TRUNC(BIN) was set in COBOL.

      Overrides:
      getBinaryAsBigIntegerField in class DatatypeFactory
      Parameters:
      precision - the number of decimal digits of precision
      scale - a negative integer specifying the power of the number
      signed - true if the value is signed
      Returns:
      BinaryAsBigIntegerField
    • getBinaryField

      public Field getBinaryField(int precision, int scale, boolean signed, boolean comp5)
      Construct and return a BinaryField, advancing the current offset by its byte length. The actual field returned is based on the precision and scale.

      Note that the field behaves as if TRUNC(BIN) was set in COBOL.

      Parameters:
      precision - the number of decimal digits of precision
      scale - the number of implied decimal digits in the fractional part of the field
      signed - true if the value is signed
      comp5 - true if the entire bit range is to be allowed
      Returns:
      Field
    • getExternalFloatField

      public ExternalFloatField getExternalFloatField(int precision, int scale, boolean showMantissaPlusSign, boolean showExponentPlusSign, boolean impliedDecimalPoint)
      Construct and return a FloatDisplayField, advancing the current offset by its byte length.
      Parameters:
      precision - the number of decimal digits of precision
      scale - the number of implied decimal digits in the fractional part of the field
      showMantissaPlusSign - true if a plus sign is to be displayed for positive mantissa values
      showExponentPlusSign - true if a plus sign is to be displayed for positive exponent values
      impliedDecimalPoint - true if the decimal point is implied.
      Returns:
      ExternalFloatField
    • getPackedDecimalField

      public Field getPackedDecimalField(int precision, int scale, boolean signed)
      Construct and return a PackedDecimalAs<*>Field, advancing the current offset by its byte length. The actual field returned is based on the precision and scale.
      Specified by:
      getPackedDecimalField in class DatatypeFactory
      Parameters:
      precision - the number of decimal digits of precision
      scale - the number of implied decimal digits to the right of the decimal point
      signed - true if the value is signed
      Returns:
      Field
      Throws:
      IllegalArgumentException - if length implies a precision > 31 digits.
      See Also: