public class ExternalDecimalAsLongField extends java.lang.Object implements LongAccessor
Constructor and Description |
---|
ExternalDecimalAsLongField(int offset,
int precision,
boolean signed,
boolean signTrailing,
boolean signExternal,
boolean blankWhenZero)
Construct an instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Long aLong,
long along)
Compare a Long, possibly null, with a long for equality.
|
int |
getByteLength()
Answer the length of the field described by the receiver
|
int |
getLength() |
long |
getLong(byte[] buffer)
Answer a long value from the given byte array buffer,
at the offset of this field.
|
long |
getLong(byte[] buffer,
int bufOffset)
Answer a long value from the given byte array buffer,
at the bufOffset + offset of this field.
|
int |
getOffset()
Answer the offset of this field into some array of bytes
|
int |
getPrecision() |
boolean |
isBlankWhenZero() |
boolean |
isSigned()
Answer whether the field is signed
|
boolean |
isSignExternal() |
boolean |
isSignTrailing() |
void |
putLong(long value,
byte[] buffer)
Put a long value into the given byte array buffer,
at the offset of this field.
|
void |
putLong(long value,
byte[] buffer,
int bufOffset)
Put a long value into the given byte array buffer,
at the bufOffset + offset of this field.
|
void |
setOffset(int offset) |
void |
setSignExternal(boolean signExternal) |
public ExternalDecimalAsLongField(int offset, int precision, boolean signed, boolean signTrailing, boolean signExternal, boolean blankWhenZero)
offset
- position of this fieldprecision
- total number of digits <= 18.signed
- 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: signTrailing and signExternal are ignored if signed is not true.public int getByteLength()
Field
getByteLength
in interface Field
public int getOffset()
Field
public void setOffset(int offset)
setOffset
in interface Field
Field.getOffset()
public long getLong(byte[] buffer)
getLong
in interface LongAccessor
buffer
- the byte arraypublic long getLong(byte[] buffer, int bufOffset)
getLong
in interface LongAccessor
buffer
- the byte arraybufOffset
- the additional offset into the byte arraypublic void putLong(long value, byte[] buffer) throws java.lang.IllegalArgumentException
putLong
in interface LongAccessor
value
- the long valuebuffer
- the byte arrayjava.lang.IllegalArgumentException
- if the value is out of rangepublic void putLong(long value, byte[] buffer, int bufOffset) throws java.lang.IllegalArgumentException
putLong
in interface LongAccessor
value
- the long valuebuffer
- the byte arraybufOffset
- the additional offset into the byte arrayjava.lang.IllegalArgumentException
- if the value is out of rangepublic boolean isSigned()
isSigned
in interface LongAccessor
public boolean equals(java.lang.Long aLong, long along)
aLong
- along
- public boolean isBlankWhenZero()
public boolean isSignExternal()
public boolean isSignTrailing()
public int getLength()
public int getPrecision()
public void setSignExternal(boolean signExternal)