Module ibm.jzos

Class ExternalFloatField

java.lang.Object
com.ibm.jzos.fields.ExternalFloatField
All Implemented Interfaces:
DoubleAccessor, Field

public class ExternalFloatField extends Object implements DoubleAccessor
A character floating point representation Field with double accessors. In Cobol, refered to as "External Float".

Since:
2.1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExternalFloatField(int offset, int precision, int scale, boolean mantSign, boolean expSign, boolean impliedDecimal)
    Construct an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Double aDouble, double adouble)
    Compare a Double with a double for equality.
    int
    Answer the length of the field described by the receiver
    double
    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 bytes
    int
     
    int
     
    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)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 field
      precision - in the number of decimal degits of precision
      scale - the number of implied decimal digits in the fractional portion of the field
      mantSign - 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 interface DoubleAccessor
      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 interface DoubleAccessor
      Parameters:
      buffer - the byte array
      bufOffset - 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 interface DoubleAccessor
      Parameters:
      value - the double value
      buffer - 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 interface DoubleAccessor
      Parameters:
      value - the double value
      buffer - the byte array
      bufOffset - 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 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:
    • equals

      public boolean equals(Double aDouble, double adouble)
      Compare a Double with a double for equality.
      Parameters:
      aDouble - possibly null
      adouble -
      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()