Class IbmFloatField
java.lang.Object
com.ibm.jzos.fields.IbmFloatField
- All Implemented Interfaces:
Field, FloatAccessor
An IBM hexadecimal floating point
Field with double accessors.
- Since:
- 2.1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompare a Float with a double for equality.intAnswer the length of the field described by the receiverfloatgetFloat(byte[] buffer) Return an IEEE (binary) float from the given byte array buffer, at the offset of this field.floatgetFloat(byte[] buffer, int bufOffset) Return an IEEE (binary) float from the given byte array buffer, at the bufOffset + offset of this field.intAnswer the offset of this field into some array of bytesvoidputFloat(float value, byte[] buffer) Put a float into the given byte array buffer, at the offset of this field.voidputFloat(float value, byte[] buffer, int bufOffset) Put a float into the given byte array buffer, at the bufOffset + offset of this field.voidsetOffset(int offset)
-
Field Details
-
BYTE_LENGTH
public static final int BYTE_LENGTH- See Also:
-
-
Constructor Details
-
IbmFloatField
public IbmFloatField(int offset) Construct an instance.- Parameters:
offset- int the offset in some byte array to the start of this field.
-
-
Method Details
-
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
-
setOffset
-
getFloat
public float getFloat(byte[] buffer) Return an IEEE (binary) float from the given byte array buffer, at the offset of this field.- Specified by:
getFloatin interfaceFloatAccessor- Parameters:
buffer- the byte array- Returns:
- float
-
getFloat
public float getFloat(byte[] buffer, int bufOffset) Return an IEEE (binary) float from the given byte array buffer, at the bufOffset + offset of this field.- Specified by:
getFloatin interfaceFloatAccessor- Parameters:
buffer- the byte arraybufOffset- the additional offset into the byte array- Returns:
- float
-
putFloat
public void putFloat(float value, byte[] buffer) Put a float into the given byte array buffer, at the offset of this field.- Specified by:
putFloatin interfaceFloatAccessor- Parameters:
value- the float valuebuffer- the byte array
-
putFloat
public void putFloat(float value, byte[] buffer, int bufOffset) Put a float into the given byte array buffer, at the bufOffset + offset of this field.- Specified by:
putFloatin interfaceFloatAccessor- Parameters:
value- the float valuebuffer- the byte arraybufOffset- the additional offset into the byte array
-
equals
Compare a Float with a double for equality.- Parameters:
aFloat- possibly nullafloat-- Returns:
- boolean true if equal, false otherwise
-