public class IbmDoubleField extends java.lang.Object implements DoubleAccessor
Field
with double accessors.Modifier and Type | Field and Description |
---|---|
static long |
ALL_NON_SIGN_BITS |
static int |
BFP_BIAS
IEEE 754 floating-point "double format" bit layout.
|
static long |
BFP_EXP_MASK
IEEE 754 floating-point "double format" bit layout.
|
static long |
BFP_FRACTION_HON |
static long |
BFP_FRACTION_IMPLIED_HOB |
static int |
BFP_FRACTION_LENGTH
IEEE 754 floating-point "double format" bit layout.
|
static long |
BFP_FRACTION_MASK
IEEE 754 floating-point "double format" bit layout.
|
static int |
BFP_INF_EXP |
static int |
BYTE_LENGTH |
static int |
HFP_BIAS
IBM hexadecimal floating-point layout.
|
static long |
HFP_EXP_MASK
IBM hexadecimal floating-point layout.
|
static int |
HFP_FRACTION_LENGTH
IBM hexadecimal floating-point layout.
|
static long |
HFP_FRACTION_MASK
IBM hexadecimal floating-point layout.
|
static int |
HFP_MAX_EXP |
static long |
SIGN_BIT
The sign bit.
|
Constructor and Description |
---|
IbmDoubleField(int offset)
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 an IEEE (binary) double from the given byte array buffer,
at the offset of this field.
|
double |
getDouble(byte[] buffer,
int bufOffset)
Return an IEEE (binary) double 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
|
void |
putDouble(double value,
byte[] buffer)
Put a double into the given byte array buffer,
at the offset of this field.
|
void |
putDouble(double value,
byte[] buffer,
int bufOffset)
Put a double into the given byte array buffer,
at the bufOffset + offset of this field.
|
void |
setOffset(int offset) |
public static final int BYTE_LENGTH
public static final long SIGN_BIT
public static final long ALL_NON_SIGN_BITS
public static final long HFP_FRACTION_MASK
public static final long BFP_FRACTION_MASK
public static final long BFP_FRACTION_IMPLIED_HOB
public static final long BFP_FRACTION_HON
public static final long HFP_EXP_MASK
public static final long BFP_EXP_MASK
public static final int HFP_FRACTION_LENGTH
public static final int BFP_FRACTION_LENGTH
public static final int HFP_BIAS
public static final int HFP_MAX_EXP
public static final int BFP_BIAS
public static final int BFP_INF_EXP
public IbmDoubleField(int offset)
offset
- int the offset in some byte array to the start of this field.public 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 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 float valuebuffer
- the byte arrayjava.lang.IllegalArgumentException
- if the resulting hexadecimal exponent is
too large to fit into the IBM representation.public void putDouble(double value, byte[] buffer, int bufOffset)
putDouble
in interface DoubleAccessor
value
- the float valuebuffer
- the byte arraybufOffset
- the additional offset into the byte arrayjava.lang.IllegalArgumentException
- if the resulting hexadecimal exponent is
too large to fit into the IBM representation.public boolean equals(java.lang.Double aDouble, double adouble)
aDouble
- possibly nulladouble
-