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 TypeMethodDescriptionbooleanCompare a Double with a double for equality.intAnswer the length of the field described by the receiverdoublegetDouble(byte[] buffer) Return a double from the given byte array buffer, at the offset of this field.doublegetDouble(byte[] buffer, int bufOffset) Return a double from the given byte array buffer, at the bufOffset + offset of this field.intintAnswer the offset of this field into some array of bytesintintgetScale()booleanbooleanbooleanvoidputDouble(double value, byte[] buffer) Put a double value into the given byte array buffer, at the offset of this field.voidputDouble(double value, byte[] buffer, int bufOffset) Put a double value into the given byte array buffer, at the bufOffset + offset of this field.voidsetOffset(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:
getDoublein 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:
getDoublein 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:
putDoublein 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:
putDoublein 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:FieldAnswer the length of the field described by the receiver- Specified by:
getByteLengthin interfaceField- Returns:
- int
- See Also:
-
getOffset
public int getOffset()Description copied from interface:FieldAnswer 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()
-