java.lang.Object
com.ibm.jzos.fields.BinaryAsBigIntegerField
- All Implemented Interfaces:
BigIntegerAccessor
,Field
- Direct Known Subclasses:
BinaryAsBigDecimalField
A binary field with
BigInteger
accessors.
- Since:
- 2.1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBinaryAsBigIntegerField
(int offset, int length, boolean signed) Construct an instance.BinaryAsBigIntegerField
(int offset, int length, int scale, boolean signed) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(BigInteger a, BigInteger b) Compare two BigInteger instances, possibly null, for equality.getBigInteger
(byte[] buffer) Answer a BigInteger from the given byte array buffer, at the offset of this field.getBigInteger
(byte[] buffer, int bufOffset) Answer a BigInteger from the given byte array buffer, at the bufOffset + offset of this field.int
Answer the length of the field described by the receiverint
int
Answer the offset of this field into some array of bytesint
getScale()
boolean
isSigned()
void
putBigInteger
(BigInteger value, byte[] buffer) Put a BigInteger into the given byte array buffer, at the offset of this field.void
putBigInteger
(BigInteger value, byte[] buffer, int bufOffset) Put a BigInteger into the given byte array buffer, at the bufOffset + offset of this field.void
setOffset
(int offset)
-
Constructor Details
-
BinaryAsBigIntegerField
public BinaryAsBigIntegerField(int offset, int length, boolean signed) Construct an instance.- Parameters:
offset
- int the offset of this fieldlength
- int the size of the field in bytessigned
- 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 fieldlength
- int the size of the field in bytesscale
- 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 interfaceField
- Returns:
- int
-
getOffset
public int getOffset()Answer the offset of this field into some array of bytes -
setOffset
public void setOffset(int offset) -
getScale
public int getScale()- Returns:
- int the scale <= 0
-
getBigInteger
Answer a BigInteger from the given byte array buffer, at the bufOffset + offset of this field.- Specified by:
getBigInteger
in interfaceBigIntegerAccessor
- Parameters:
buffer
- the byte arraybufOffset
- the additional offset into the byte array- Returns:
- BigInteger
-
getBigInteger
Answer a BigInteger from the given byte array buffer, at the offset of this field.- Specified by:
getBigInteger
in interfaceBigIntegerAccessor
- 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 interfaceBigIntegerAccessor
- Parameters:
value
- the BigInteger valuebuffer
- the byte arraybufOffset
- the additional offset into the byte array- Throws:
IllegalArgumentException
- if the value is out of range
-
putBigInteger
Put a BigInteger into the given byte array buffer, at the offset of this field.- Specified by:
putBigInteger
in interfaceBigIntegerAccessor
- Parameters:
value
- the BigInteger valuebuffer
- the byte array- Throws:
IllegalArgumentException
- if the value is out of range
-
equals
Compare two BigInteger instances, possibly null, for equality.- Parameters:
a
- BigIntegerb
- BigInteger- Returns:
- boolean true if equal, false otherwise
-
getLength
public int getLength() -
isSigned
public boolean isSigned()
-