java.lang.Object
com.ibm.jzos.fields.ExternalFloatField
- All Implemented Interfaces:
DoubleAccessor
,Field
A character floating point representation
Field
with double accessors.
In Cobol, refered to as "External Float".
- Since:
- 2.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionExternalFloatField
(int offset, int precision, int scale, boolean mantSign, boolean expSign, boolean impliedDecimal) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare a Double with a double for equality.int
Answer the length of the field described by the receiverdouble
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
int
Answer the offset of this field into some array of bytesint
int
getScale()
boolean
boolean
boolean
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)
-
Constructor Details
-
ExternalFloatField
public ExternalFloatField(int offset, int precision, int scale, boolean mantSign, boolean expSign, boolean impliedDecimal) Construct an instance.- Parameters:
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 explicit
-
-
Method Details
-
getDouble
public double getDouble(byte[] buffer) Return a double from the given byte array buffer, at the offset of this field.- Specified by:
getDouble
in interfaceDoubleAccessor
- Parameters:
buffer
- the byte array- Returns:
- double
-
getDouble
public double getDouble(byte[] buffer, int bufOffset) Return a double from the given byte array buffer, at the bufOffset + offset of this field.- Specified by:
getDouble
in interfaceDoubleAccessor
- Parameters:
buffer
- the byte arraybufOffset
- the additional offset into the byte array- Returns:
- double
-
putDouble
public void putDouble(double value, byte[] buffer) Put a double value into the given byte array buffer, at the offset of this field.- Specified by:
putDouble
in interfaceDoubleAccessor
- Parameters:
value
- the double valuebuffer
- the byte array- Throws:
IllegalArgumentException
- if the value is Infinity or NaN
-
putDouble
public 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.- Specified by:
putDouble
in interfaceDoubleAccessor
- Parameters:
value
- the double valuebuffer
- the byte arraybufOffset
- the additional offset into the byte array- Throws:
IllegalArgumentException
- if the value is Infinity or NaN
-
getByteLength
public int getByteLength()Description copied from interface:Field
Answer the length of the field described by the receiver- Specified by:
getByteLength
in interfaceField
- Returns:
- int
- See Also:
-
getOffset
public int getOffset()Description copied from interface:Field
Answer the offset of this field into some array of bytes -
setOffset
public void setOffset(int offset) -
equals
Compare a Double with a double for equality.- Parameters:
aDouble
- possibly nulladouble
-- Returns:
- boolean true if equal, false otherwise
-
isImpliedDecimal
public boolean isImpliedDecimal() -
getLength
public int getLength() -
getPrecision
public int getPrecision() -
getScale
public int getScale() -
isShowExponentPlusSign
public boolean isShowExponentPlusSign() -
isShowMantissaPlusSign
public boolean isShowMantissaPlusSign()
-