Module ibm.jzos

Class IbmFloatField

java.lang.Object
com.ibm.jzos.fields.IbmFloatField
All Implemented Interfaces:
Field, FloatAccessor

public class IbmFloatField extends Object implements FloatAccessor
An IBM hexadecimal floating point Field with double accessors.

Since:
2.1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    IbmFloatField(int offset)
    Construct an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Float aFloat, float afloat)
    Compare a Float with a double for equality.
    int
    Answer the length of the field described by the receiver
    float
    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
    Answer the offset of this field into some array of bytes
    void
    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)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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: Field
      Answer the length of the field described by the receiver
      Specified by:
      getByteLength in interface Field
      Returns:
      int
      See Also:
    • getOffset

      public int getOffset()
      Description copied from interface: Field
      Answer the offset of this field into some array of bytes
      Specified by:
      getOffset in interface Field
      Returns:
      int
      See Also:
    • setOffset

      public void setOffset(int offset)
      Specified by:
      setOffset in interface Field
      See Also:
    • 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 interface FloatAccessor
      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 interface FloatAccessor
      Parameters:
      buffer - the byte array
      bufOffset - 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 interface FloatAccessor
      Parameters:
      value - the float value
      buffer - 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 interface FloatAccessor
      Parameters:
      value - the float value
      buffer - the byte array
      bufOffset - the additional offset into the byte array
    • equals

      public boolean equals(Float aFloat, float afloat)
      Compare a Float with a double for equality.
      Parameters:
      aFloat - possibly null
      afloat -
      Returns:
      boolean true if equal, false otherwise