java.lang.Object
com.ibm.jzos.fields.ExternalDecimalAsBigIntegerField
- All Implemented Interfaces:
BigIntegerAccessor,Field
An external (aka "zoned" or "display") decimal field up to 31 digits with BigInteger accessors.
- Since:
- 2.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionExternalDecimalAsBigIntegerField(int offset, int precision, int scale, boolean signed, boolean signTrailing, boolean signExternal, boolean blankWhenZero) Construct an instance -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(BigInteger a, BigInteger b) Compare two BigInteger instances, possibly null, for equality.getBigInteger(byte[] buffer) Answer a BigInteger value from the given byte array buffer, at the offset of this field.getBigInteger(byte[] buffer, int bufOffset) Answer a BigInteger value from the given byte array buffer, at the bufOffset + offset of this field.intAnswer the length of the field described by the receiverintAnswer the offset of this field into some array of bytesintintgetScale()booleanbooleanisSigned()booleanbooleanvoidputBigInteger(BigInteger value, byte[] buffer) Put a BigInteger value into the given byte array buffer, at the offset of this field.voidputBigInteger(BigInteger value, byte[] buffer, int bufOffset) Put a BigInteger value into the given byte array buffer, at the bufOffset + offset of this field.voidsetOffset(int offset)
-
Constructor Details
-
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 fieldprecision- total number of digits invalid input: '<'= 18.scale- a number implied extra digits invalid input: '<'=0 in the whole number portion of the fieldsigned- if the field has a sign somewheresignTrailing- true if the sign follows the field, false if it precedes itsignExternal- 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 Details
-
getByteLength
public int getByteLength()Description copied from interface:FieldAnswer the length of the field described by the receiver- Specified by:
getByteLengthin interfaceField- Returns:
- int
-
getOffset
public int getOffset()Description copied from interface:FieldAnswer the offset of this field into some array of bytes -
setOffset
public void setOffset(int offset) -
getPrecision
public int getPrecision() -
getBigInteger
Answer a BigInteger value from the given byte array buffer, at the offset of this field.- Specified by:
getBigIntegerin interfaceBigIntegerAccessor- Parameters:
buffer- the byte array- Returns:
- BigInteger
-
getBigInteger
Answer a BigInteger value from the given byte array buffer, at the bufOffset + offset of this field.- Specified by:
getBigIntegerin interfaceBigIntegerAccessor- Parameters:
buffer- the byte arraybufOffset- the additional offset into the byte array- Returns:
- BigInteger
-
putBigInteger
Put a BigInteger value into the given byte array buffer, at the offset of this field.- Specified by:
putBigIntegerin interfaceBigIntegerAccessor- Parameters:
value- the BigInteger valuebuffer- the byte array- Throws:
IllegalArgumentException- if the value is out of range
-
putBigInteger
public void putBigInteger(BigInteger value, byte[] buffer, int bufOffset) throws IllegalArgumentException Put a BigInteger value into the given byte array buffer, at the bufOffset + offset of this field.- Specified by:
putBigIntegerin 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
-
equals
Compare two BigInteger instances, possibly null, for equality.- Parameters:
a- BigIntegerb- 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()
-