Module ibm.jzos

Class ExternalDecimalAsBigIntegerField

  • All Implemented Interfaces:
    BigIntegerAccessor, Field

    public class ExternalDecimalAsBigIntegerField
    extends java.lang.Object
    implements BigIntegerAccessor
    An external (aka "zoned" or "display") decimal field up to 31 digits with BigInteger accessors.

    Since:
    2.1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      ExternalDecimalAsBigIntegerField​(int offset, int precision, int scale, boolean signed, boolean signTrailing, boolean signExternal, boolean blankWhenZero)
      Construct an instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.math.BigInteger a, java.math.BigInteger b)
      Compare two BigInteger instances, possibly null, for equality.
      java.math.BigInteger getBigInteger​(byte[] buffer)
      Answer a BigInteger value from the given byte array buffer, at the offset of this field.
      java.math.BigInteger getBigInteger​(byte[] buffer, int bufOffset)
      Answer a BigInteger value from the given byte array buffer, at the bufOffset + offset of this field.
      int getByteLength()
      Answer the length of the field described by the receiver
      int getOffset()
      Answer the offset of this field into some array of bytes
      int getPrecision()  
      int getScale()  
      boolean isBlankWhenZero()  
      boolean isSigned()  
      boolean isSignExternal()  
      boolean isSignTrailing()  
      void putBigInteger​(java.math.BigInteger value, byte[] buffer)
      Put a BigInteger value into the given byte array buffer, at the offset of this field.
      void putBigInteger​(java.math.BigInteger value, byte[] buffer, int bufOffset)
      Put a BigInteger value into the given byte array buffer, at the bufOffset + offset of this field.
      void setOffset​(int offset)  
      • Methods inherited from class java.lang.Object

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

      • ExternalDecimalAsBigIntegerField

        public ExternalDecimalAsBigIntegerField​(int offset,
                                                int precision,
                                                int scale,
                                                boolean signed,
                                                boolean signTrailing,
                                                boolean signExternal,
                                                boolean blankWhenZero)
        Construct an instance
        Parameters:
        offset - position of this field
        precision - total number of digits <= 18.
        scale - a number implied extra digits <=0 in the whole number portion of the field
        signed - if the field has a sign somewhere
        signTrailing - true if the sign follows the field, false if it precedes it
        signExternal - true if the sign occupies a separate byte, false if it only occupies a high-order nibble Note: signTailing and signExternal are ignored if signed is not true.
    • Method Detail

      • getByteLength

        public int getByteLength()
        Description copied from interface: Field
        Answer the length of the field described by the receiver
        Specified by:
        getByteLength in interface Field
        Returns:
        int
      • getOffset

        public int getOffset()
        Description copied from interface: Field
        Answer the offset of this field into some array of bytes
        Specified by:
        getOffset in interface Field
        Returns:
        int
      • getPrecision

        public int getPrecision()
      • getBigInteger

        public java.math.BigInteger getBigInteger​(byte[] buffer)
        Answer a BigInteger value from the given byte array buffer, at the offset of this field.
        Specified by:
        getBigInteger in interface BigIntegerAccessor
        Parameters:
        buffer - the byte array
        Returns:
        BigInteger
      • getBigInteger

        public java.math.BigInteger getBigInteger​(byte[] buffer,
                                                  int bufOffset)
        Answer a BigInteger value from the given byte array buffer, at the bufOffset + offset of this field.
        Specified by:
        getBigInteger in interface BigIntegerAccessor
        Parameters:
        buffer - the byte array
        bufOffset - the additional offset into the byte array
        Returns:
        BigInteger
      • putBigInteger

        public void putBigInteger​(java.math.BigInteger value,
                                  byte[] buffer)
                           throws java.lang.IllegalArgumentException
        Put a BigInteger value into the given byte array buffer, at the offset of this field.
        Specified by:
        putBigInteger in interface BigIntegerAccessor
        Parameters:
        value - the BigInteger value
        buffer - the byte array
        Throws:
        java.lang.IllegalArgumentException - if the value is out of range
      • putBigInteger

        public void putBigInteger​(java.math.BigInteger value,
                                  byte[] buffer,
                                  int bufOffset)
                           throws java.lang.IllegalArgumentException
        Put a BigInteger value into the given byte array buffer, at the bufOffset + offset of this field.
        Specified by:
        putBigInteger in interface BigIntegerAccessor
        Parameters:
        value - the BigInteger value
        buffer - the byte array
        bufOffset - the additional offset into the byte array
        Throws:
        java.lang.IllegalArgumentException - if the value is out of range
      • equals

        public boolean equals​(java.math.BigInteger a,
                              java.math.BigInteger b)
        Compare two BigInteger instances, possibly null, for equality.
        Parameters:
        a - BigInteger
        b - BigInteger
        Returns:
        boolean true if equal, false otherwise
      • isBlankWhenZero

        public boolean isBlankWhenZero()
      • getScale

        public int getScale()
      • isSigned

        public boolean isSigned()
      • isSignExternal

        public boolean isSignExternal()
      • isSignTrailing

        public boolean isSignTrailing()