|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.jzos.fields.ExternalDecimalAsBigDecimalField
public class ExternalDecimalAsBigDecimalField
An external (aka "display", "zoned") decimal field with BigDecimal accessors. A "scale" determines the implied number of digits to the right of the decimal point.
Constructor Summary | |
---|---|
ExternalDecimalAsBigDecimalField(int offset,
int precision,
int scale,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
Construct an instance |
Method Summary | |
---|---|
boolean |
equals(java.math.BigDecimal a,
java.math.BigDecimal b)
Compare two BigDecimal instances, possibly null, for equality. |
java.math.BigDecimal |
getBigDecimal(byte[] buffer)
Answer a BigDecimal from the given byte array buffer, at the offset of this field. |
java.math.BigDecimal |
getBigDecimal(byte[] buffer,
int bufOffset)
Answer a BigDecimal from the given byte array buffer, at the bufOffset + offset of this field. |
int |
getByteLength()
Answer the length of the field described by the receiver |
int |
getOffset()
Answer the offset of this field into some array of bytes |
int |
getPrecision()
|
int |
getScale()
|
boolean |
isBlankWhenZero()
|
boolean |
isSigned()
|
boolean |
isSignExternal()
|
boolean |
isSignTrailing()
|
void |
putBigDecimal(java.math.BigDecimal value,
byte[] buffer)
Put a BigDecimal into the given byte array buffer, at the offset of this field. |
void |
putBigDecimal(java.math.BigDecimal value,
byte[] buffer,
int bufOffset)
Put a BigDecimal into the given byte array buffer, at the bufOffset + offset of this field. |
void |
setOffset(int offset)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExternalDecimalAsBigDecimalField(int offset, int precision, int scale, boolean signed, boolean signTrailing, boolean signExternal, boolean blankWhenZero)
offset
- position of this fieldprecision
- total number of digits.scale
- number of digits (>=0) to the right of decimal pointsigned
- 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 Detail |
---|
public int getByteLength()
Field
getByteLength
in interface Field
public int getOffset()
Field
getOffset
in interface Field
public void setOffset(int offset)
setOffset
in interface Field
Field.getOffset()
public int getPrecision()
public boolean isSigned()
public boolean isSignExternal()
public boolean isSignTrailing()
public boolean isBlankWhenZero()
public java.math.BigDecimal getBigDecimal(byte[] buffer)
BigDecimalAccessor
getBigDecimal
in interface BigDecimalAccessor
buffer
- the byte array
public java.math.BigDecimal getBigDecimal(byte[] buffer, int bufOffset)
BigDecimalAccessor
getBigDecimal
in interface BigDecimalAccessor
buffer
- the byte arraybufOffset
- the additional offset into the byte array
public void putBigDecimal(java.math.BigDecimal value, byte[] buffer) throws java.lang.IllegalArgumentException
BigDecimalAccessor
putBigDecimal
in interface BigDecimalAccessor
value
- the BigDecimal valuebuffer
- the byte array
java.lang.IllegalArgumentException
- if the value is out of rangepublic void putBigDecimal(java.math.BigDecimal value, byte[] buffer, int bufOffset) throws java.lang.IllegalArgumentException
BigDecimalAccessor
putBigDecimal
in interface BigDecimalAccessor
value
- the BigDecimal valuebuffer
- the byte arraybufOffset
- the additional offset into the byte array
java.lang.IllegalArgumentException
- if the value is out of rangepublic boolean equals(java.math.BigDecimal a, java.math.BigDecimal b)
a
- BigDecimalb
- BigDecimal
public int getScale()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |