com.ibm.jzos.fields
Class IbmFloatField
- java.lang.Object
-
- com.ibm.jzos.fields.IbmFloatField
-
- All Implemented Interfaces:
- Field, FloatAccessor
public class IbmFloatField extends java.lang.Object implements FloatAccessor
An IBM hexadecimal floating pointField
with double accessors.- Since:
- 2.1.0
-
-
Field Summary
Fields Modifier and Type Field and Description static int
BYTE_LENGTH
-
Constructor Summary
Constructors Constructor and Description IbmFloatField(int offset)
Construct an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(java.lang.Float aFloat, float afloat)
Compare a Float with a double for equality.int
getByteLength()
Answer the length of the field described by the receiverfloat
getFloat(byte[] buffer)
Return an IEEE (binary) float from the given byte array buffer, at the offset of this field.float
getFloat(byte[] buffer, int bufOffset)
Return an IEEE (binary) float 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 bytesvoid
putFloat(float value, byte[] buffer)
Put a float into the given byte array buffer, at the offset of this field.void
putFloat(float value, byte[] buffer, int bufOffset)
Put a float into the given byte array buffer, at the bufOffset + offset of this field.void
setOffset(int offset)
-
-
-
Field Detail
-
BYTE_LENGTH
public static final int BYTE_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
IbmFloatField
public IbmFloatField(int offset)
Construct an instance.- Parameters:
offset
- int the offset in some byte array to the start of this field.
-
-
Method Detail
-
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:
Field.getByteLength()
-
getOffset
public int getOffset()
Description copied from interface:Field
Answer the offset of this field into some array of bytes- Specified by:
getOffset
in interfaceField
- Returns:
- int
- See Also:
Field.getOffset()
-
setOffset
public void setOffset(int offset)
- Specified by:
setOffset
in interfaceField
- See Also:
Field.setOffset(int)
-
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:
getFloat
in 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:
getFloat
in 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:
putFloat
in 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:
putFloat
in interfaceFloatAccessor
- Parameters:
value
- the float valuebuffer
- the byte arraybufOffset
- the additional offset into the byte array
-
equals
public boolean equals(java.lang.Float aFloat, float afloat)
Compare a Float with a double for equality.- Parameters:
aFloat
- possibly nullafloat
-- Returns:
- boolean true if equal, false otherwise
-
-