public class ExternalFloatField extends java.lang.Object implements DoubleAccessor
Field
with double accessors.
In Cobol, refered to as "External Float".
Constructor and Description |
---|
ExternalFloatField(int offset,
int precision,
int scale,
boolean mantSign,
boolean expSign,
boolean impliedDecimal)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Double aDouble,
double adouble)
Compare a Double with a double for equality.
|
int |
getByteLength()
Answer the length of the field described by the receiver
|
double |
getDouble(byte[] buffer)
Return a double from the given byte array buffer,
at the offset of this field.
|
double |
getDouble(byte[] buffer,
int bufOffset)
Return a double from the given byte array buffer,
at the bufOffset + offset of this field.
|
int |
getLength() |
int |
getOffset()
Answer the offset of this field into some array of bytes
|
int |
getPrecision() |
int |
getScale() |
boolean |
isImpliedDecimal() |
boolean |
isShowExponentPlusSign() |
boolean |
isShowMantissaPlusSign() |
void |
putDouble(double value,
byte[] buffer)
Put a double value into the given byte array buffer,
at the offset of this field.
|
void |
putDouble(double value,
byte[] buffer,
int bufOffset)
Put a double value into the given byte array buffer,
at the bufOffset + offset of this field.
|
void |
setOffset(int offset) |
public ExternalFloatField(int offset, int precision, int scale, boolean mantSign, boolean expSign, boolean impliedDecimal)
offset
- int the offset of this fieldprecision
- in the number of decimal degits of precisionscale
- the number of implied decimal digits in the
fractional portion of the fieldmantSign
- true if the '+' character is present for positive mantissa values.
A minus character '-' is always present for negative values.expSign
- true if the '+' character is present for positive exponent values
A minus character '-' is always present for negative values.impliedDecimal
- true if the decimal point is not explicitpublic double getDouble(byte[] buffer)
getDouble
in interface DoubleAccessor
buffer
- the byte arraypublic double getDouble(byte[] buffer, int bufOffset)
getDouble
in interface DoubleAccessor
buffer
- the byte arraybufOffset
- the additional offset into the byte arraypublic void putDouble(double value, byte[] buffer)
putDouble
in interface DoubleAccessor
value
- the double valuebuffer
- the byte arrayjava.lang.IllegalArgumentException
- if the value is Infinity or NaNpublic void putDouble(double value, byte[] buffer, int bufOffset)
putDouble
in interface DoubleAccessor
value
- the double valuebuffer
- the byte arraybufOffset
- the additional offset into the byte arrayjava.lang.IllegalArgumentException
- if the value is Infinity or NaNpublic int getByteLength()
Field
getByteLength
in interface Field
Field.getByteLength()
public int getOffset()
Field
getOffset
in interface Field
Field.getOffset()
public void setOffset(int offset)
setOffset
in interface Field
Field.setOffset(int)
public boolean equals(java.lang.Double aDouble, double adouble)
aDouble
- possibly nulladouble
- public boolean isImpliedDecimal()
public int getLength()
public int getPrecision()
public int getScale()
public boolean isShowExponentPlusSign()
public boolean isShowMantissaPlusSign()