Module ibm.jzos

Class PackedBigDecimalP12Field

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.math.BigDecimal getBigDecimal​(byte[] buffer)
      Answer a BigDecimal from the given byte array buffer, at the offset of this field.
      java.math.BigDecimal getBigDecimal​(byte[] buffer, int bufOffset)
      Answer a BigDecimal from the given byte array buffer, at the bufOffset + offset of this field.
      void putBigDecimal​(java.math.BigDecimal value, byte[] buffer)
      Put a BigDecimal into the given byte array buffer, at the offset of this field.
      void putBigDecimal​(java.math.BigDecimal value, byte[] buffer, int bufOffset)
      Put a BigDecimal into the given byte array buffer, at the bufOffset + offset of this field.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PackedBigDecimalP12Field

        public PackedBigDecimalP12Field​(int offset,
                                        int scale)
    • Method Detail

      • getBigDecimal

        public java.math.BigDecimal getBigDecimal​(byte[] buffer,
                                                  int bufOffset)
                                           throws java.lang.IllegalArgumentException
        Description copied from class: PackedDecimalAsBigDecimalField
        Answer a BigDecimal from the given byte array buffer, at the bufOffset + offset of this field.

        Note: the data is not checked for valid decimal digits, although the sign nibble is checked for a valid value in the range x'A'-x'F'.

        Specified by:
        getBigDecimal in interface BigDecimalAccessor
        Overrides:
        getBigDecimal in class PackedBigDecimalField
        Parameters:
        buffer - the byte array
        bufOffset - the additional offset into the byte array
        Returns:
        BigDecimal
        Throws:
        java.lang.IllegalArgumentException - if the data has a invalid sign nibble
      • getBigDecimal

        public java.math.BigDecimal getBigDecimal​(byte[] buffer)
                                           throws java.lang.IllegalArgumentException
        Description copied from class: PackedDecimalAsBigDecimalField
        Answer a BigDecimal from the given byte array buffer, at the offset of this field.

        Note: the data is not checked for valid decimal digits, although the sign nibble is checked for a valid value in the range x'A'-x'F'.

        Specified by:
        getBigDecimal in interface BigDecimalAccessor
        Overrides:
        getBigDecimal in class PackedBigDecimalField
        Parameters:
        buffer - the byte array
        Returns:
        BigDecimal
        Throws:
        java.lang.IllegalArgumentException - if the data has a invalid sign nibble
      • putBigDecimal

        public void putBigDecimal​(java.math.BigDecimal value,
                                  byte[] buffer,
                                  int bufOffset)
                           throws java.lang.IllegalArgumentException
        Description copied from class: PackedDecimalAsBigDecimalField
        Put a BigDecimal into the given byte array buffer, at the bufOffset + offset of this field.

        Note: if the field is unsigned, a x'F' is supplied as the sign nibble in the field.

        Specified by:
        putBigDecimal in interface BigDecimalAccessor
        Overrides:
        putBigDecimal in class PackedBigDecimalField
        Parameters:
        value - the BigDecimal value
        buffer - the byte array
        bufOffset - the additional offset into the byte array
        Throws:
        java.lang.IllegalArgumentException - if the value is out of range
      • putBigDecimal

        public void putBigDecimal​(java.math.BigDecimal value,
                                  byte[] buffer)
                           throws java.lang.IllegalArgumentException
        Description copied from class: PackedDecimalAsBigDecimalField
        Put a BigDecimal into the given byte array buffer, at the offset of this field.

        Note: if the field is unsigned, a x'F' is supplied as the sign nibble in the field.

        Specified by:
        putBigDecimal in interface BigDecimalAccessor
        Overrides:
        putBigDecimal in class PackedBigDecimalField
        Parameters:
        value - the BigDecimal value
        buffer - the byte array
        Throws:
        java.lang.IllegalArgumentException - if the value is out of range