Class NumericFormatFloat


public final class NumericFormatFloat extends AbstractNumericFormat
Used for representation of COMP_2 and COMP_4 variables. COMPUTATIONAL-4 or COMP-4 Specified for internal floating-point items (single precision). COMP-4 items are 4 bytes long. The sign is contained in the first bit of the leftmost byte and the exponent is contained in the remaining 7 bits. The last 3 bytes contain the mantissa.
  • Field Details

  • Constructor Details

    • NumericFormatFloat

      public NumericFormatFloat(String picture, boolean longFloat)
  • Method Details

    • calcFractionSize

      protected int calcFractionSize(String picture)
    • isCompressed

      public final boolean isCompressed()
      Specified by:
      isCompressed in class Format
    • getStorageCellSize

      public final int getStorageCellSize()
      Description copied from class: Format
      This is the number of characters in field.
      For example, PIC X(10) will have 10 characters
      or PIC 9(16) will have 16 characters
      but PIC 9(16) COMP-3 will have 8 characters
      Specified by:
      getStorageCellSize in class Format
      Returns:
      cellsize
    • getNumberOfDigits

      public int getNumberOfDigits()
      Returns the number of integer digits of used for Integer and Decimal parts of a number. For example, given a definition of S9(5)v9(3); the NumberOfDigists is 11.
      Specified by:
      getNumberOfDigits in class Format
      Returns:
    • getIntegerSize

      public int getIntegerSize()
      Returns the number of integer digits of used for Integer and Decimal parts of a number. For example, given a definition of S9(5)v9(3); the NumberOfDigists is 11.
      Returns:
    • convertFromDisplayToStorage

      public final String convertFromDisplayToStorage(long value, boolean[] sizeError)
      format a value according to the PIC definition
      Overrides:
      convertFromDisplayToStorage in class Format
    • convertFromDisplayToStorage

      public final String convertFromDisplayToStorage(double value, boolean[] sizeError)
      format a value according to the PIC definition
      Specified by:
      convertFromDisplayToStorage in class Format
    • convertFromDisplayToStorage

      public String convertFromDisplayToStorage(BigDecimal value, boolean[] sizeError)
      format a value according to the PIC definition
      Specified by:
      convertFromDisplayToStorage in class Format
    • convertFromDisplayToStorage

      public String convertFromDisplayToStorage(BigInteger value, boolean[] sizeError)
      format a value according to the PIC definition
      Specified by:
      convertFromDisplayToStorage in class Format
    • convertFromDisplayToStorage

      public final String convertFromDisplayToStorage(String _value, boolean[] sizeError)
      format a value according to the PIC definition
      Specified by:
      convertFromDisplayToStorage in class Format
    • convertFromStorageToDisplayFormat

      public final String convertFromStorageToDisplayFormat(String formattedString)
      Specified by:
      convertFromStorageToDisplayFormat in class Format
    • getSQLObject

      public final Object getSQLObject(String formattedString)
      Specified by:
      getSQLObject in class Format