- java.lang.Object
-
- com.ibm.jzos.fields.BinaryAsBigIntegerField
-
- All Implemented Interfaces:
BigIntegerAccessor
,Field
- Direct Known Subclasses:
BinaryAsBigDecimalField
public class BinaryAsBigIntegerField extends java.lang.Object implements BigIntegerAccessor
A binary field withBigInteger
accessors.- Since:
- 2.1.0
- See Also:
Field
,BigIntegerAccessor
-
-
Constructor Summary
Constructors Constructor Description BinaryAsBigIntegerField(int offset, int length, boolean signed)
Construct an instance.BinaryAsBigIntegerField(int offset, int length, int scale, boolean signed)
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 from the given byte array buffer, at the offset of this field.java.math.BigInteger
getBigInteger(byte[] buffer, int bufOffset)
Answer a BigInteger from the given byte array buffer, at the bufOffset + offset of this field.int
getByteLength()
Answer the length of the field described by the receiverint
getLength()
int
getOffset()
Answer the offset of this field into some array of bytesint
getScale()
boolean
isSigned()
void
putBigInteger(java.math.BigInteger value, byte[] buffer)
Put a BigInteger 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 into the given byte array buffer, at the bufOffset + offset of this field.void
setOffset(int offset)
-
-
-
Constructor Detail
-
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 Detail
-
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)
- Specified by:
setOffset
in interfaceField
- See Also:
getOffset()
-
getScale
public int getScale()
- Returns:
- int the scale <= 0
-
getBigInteger
public java.math.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 interfaceBigIntegerAccessor
- Parameters:
buffer
- the byte arraybufOffset
- the additional offset into the byte array- Returns:
- BigInteger
-
getBigInteger
public java.math.BigInteger getBigInteger(byte[] buffer)
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(java.math.BigInteger value, byte[] buffer, int bufOffset) throws java.lang.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:
java.lang.IllegalArgumentException
- if the value is out of range
-
putBigInteger
public void putBigInteger(java.math.BigInteger value, byte[] buffer) throws java.lang.IllegalArgumentException
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:
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
- BigIntegerb
- BigInteger- Returns:
- boolean true if equal, false otherwise
-
getLength
public int getLength()
-
isSigned
public boolean isSigned()
-
-