Module ibm.jzos

Class BinaryAsBigIntegerField

java.lang.Object
com.ibm.jzos.fields.BinaryAsBigIntegerField
All Implemented Interfaces:
BigIntegerAccessor, Field
Direct Known Subclasses:
BinaryAsBigDecimalField

public class BinaryAsBigIntegerField extends Object implements BigIntegerAccessor
A binary field with BigInteger accessors.

Since:
2.1.0
See Also:
  • Constructor Details

    • BinaryAsBigIntegerField

      public BinaryAsBigIntegerField(int offset, int length, boolean signed)
      Construct an instance.

      Parameters:
      offset - int the offset of this field
      length - int the size of the field in bytes
      signed - boolean true if the value is signed, false if unsigned
    • BinaryAsBigIntegerField

      public BinaryAsBigIntegerField(int offset, int length, int scale, boolean signed)
      Construct an instance.

      Parameters:
      offset - int the offset of this field
      length - int the size of the field in bytes
      scale - a number <=0 implying a scaling factor to be muliplied by the stored byte value. For example, -1, would mean that the external value was 10 times the internal value.
      signed - boolean true if the value is signed, false if unsigned
  • Method Details

    • getByteLength

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

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

      public void setOffset(int offset)
      Specified by:
      setOffset in interface Field
      See Also:
    • getScale

      public int getScale()
      Returns:
      int the scale <= 0
    • getBigInteger

      public BigInteger getBigInteger(byte[] buffer, int bufOffset)
      Answer a BigInteger 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
    • getBigInteger

      public BigInteger getBigInteger(byte[] buffer)
      Answer a BigInteger 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
    • putBigInteger

      public void putBigInteger(BigInteger value, byte[] buffer, int bufOffset) throws IllegalArgumentException
      Put a BigInteger 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:
      IllegalArgumentException - if the value is out of range
    • putBigInteger

      public void putBigInteger(BigInteger value, byte[] buffer) throws IllegalArgumentException
      Put a BigInteger 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:
      IllegalArgumentException - if the value is out of range
    • equals

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

      public int getLength()
    • isSigned

      public boolean isSigned()