Class COSFloat

All Implemented Interfaces:
COSObjectable

public class COSFloat extends COSNumber
This class represents a floating point number in a PDF document.
Author:
Ben Litchfield
  • Field Details

    • ZERO

      public static final COSFloat ZERO
    • ONE

      public static final COSFloat ONE
  • Constructor Details

    • COSFloat

      public COSFloat(float aFloat)
      Constructor.
      Parameters:
      aFloat - The primitive float object that this object wraps.
    • COSFloat

      public COSFloat(String aFloat) throws IOException
      Constructor.
      Parameters:
      aFloat - The primitive float object that this object wraps.
      Throws:
      IOException - If aFloat is not a float.
  • Method Details

    • floatValue

      public float floatValue()
      The value of the float object that this one wraps.
      Specified by:
      floatValue in class COSNumber
      Returns:
      The value of this object.
    • longValue

      public long longValue()
      This will get the long value of this object.
      Specified by:
      longValue in class COSNumber
      Returns:
      The long value of this object,
    • intValue

      public int intValue()
      This will get the integer value of this object.
      Specified by:
      intValue in class COSNumber
      Returns:
      The int value of this object,
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • accept

      public void accept(ICOSVisitor visitor) throws IOException
      Visitor pattern double dispatch method.
      Specified by:
      accept in class COSBase
      Parameters:
      visitor - The object to notify when visiting this object.
      Throws:
      IOException - If an error occurs while visiting this object.
    • writePDF

      public void writePDF(OutputStream output) throws IOException
      This will output this string as a PDF object.
      Parameters:
      output - The stream to write to.
      Throws:
      IOException - If there is an error writing to the stream.