java.lang.Object
com.ibm.jzos.fields.PackedDecimalAsBigDecimalField
com.ibm.jzos.fields.daa.PackedBigDecimalField
com.ibm.jzos.fields.daa.PackedBigDecimalP9Field
- All Implemented Interfaces:
BigDecimalAccessor
,Field
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBigDecimal
(byte[] buffer) Answer a BigDecimal from the given byte array buffer, at the offset of this field.getBigDecimal
(byte[] buffer, int bufOffset) Answer a BigDecimal from the given byte array buffer, at the bufOffset + offset of this field.void
putBigDecimal
(BigDecimal value, byte[] buffer) Put a BigDecimal into the given byte array buffer, at the offset of this field.void
putBigDecimal
(BigDecimal value, byte[] buffer, int bufOffset) Put a BigDecimal into the given byte array buffer, at the bufOffset + offset of this field.Methods inherited from class com.ibm.jzos.fields.PackedDecimalAsBigDecimalField
equals, getByteLength, getOffset, getPrecision, getScale, isSigned, setOffset
-
Constructor Details
-
PackedBigDecimalP9Field
public PackedBigDecimalP9Field(int offset, int scale)
-
-
Method Details
-
getBigDecimal
Description copied from class:PackedDecimalAsBigDecimalField
Answer a BigDecimal from the given byte array buffer, at the bufOffset + offset of this field.Note: the data is not checked for valid decimal digits, although the sign nibble is checked for a valid value in the range x'A'-x'F'.
- Specified by:
getBigDecimal
in interfaceBigDecimalAccessor
- Overrides:
getBigDecimal
in classPackedBigDecimalField
- Parameters:
buffer
- the byte arraybufOffset
- the additional offset into the byte array- Returns:
- BigDecimal
- Throws:
IllegalArgumentException
- if the data has a invalid sign nibble
-
getBigDecimal
Description copied from class:PackedDecimalAsBigDecimalField
Answer a BigDecimal from the given byte array buffer, at the offset of this field.Note: the data is not checked for valid decimal digits, although the sign nibble is checked for a valid value in the range x'A'-x'F'.
- Specified by:
getBigDecimal
in interfaceBigDecimalAccessor
- Overrides:
getBigDecimal
in classPackedBigDecimalField
- Parameters:
buffer
- the byte array- Returns:
- BigDecimal
- Throws:
IllegalArgumentException
- if the data has a invalid sign nibble
-
putBigDecimal
public void putBigDecimal(BigDecimal value, byte[] buffer, int bufOffset) throws IllegalArgumentException Description copied from class:PackedDecimalAsBigDecimalField
Put a BigDecimal into the given byte array buffer, at the bufOffset + offset of this field.Note: if the field is unsigned, a x'F' is supplied as the sign nibble in the field.
- Specified by:
putBigDecimal
in interfaceBigDecimalAccessor
- Overrides:
putBigDecimal
in classPackedBigDecimalField
- Parameters:
value
- the BigDecimal valuebuffer
- the byte arraybufOffset
- the additional offset into the byte array- Throws:
IllegalArgumentException
- if the value is out of range
-
putBigDecimal
Description copied from class:PackedDecimalAsBigDecimalField
Put a BigDecimal into the given byte array buffer, at the offset of this field.Note: if the field is unsigned, a x'F' is supplied as the sign nibble in the field.
- Specified by:
putBigDecimal
in interfaceBigDecimalAccessor
- Overrides:
putBigDecimal
in classPackedBigDecimalField
- Parameters:
value
- the BigDecimal valuebuffer
- the byte array- Throws:
IllegalArgumentException
- if the value is out of range
-