Class COSNumber

java.lang.Object
org.sejda.sambox.cos.COSBase
org.sejda.sambox.cos.COSNumber
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
COSFloat, COSInteger

public abstract class COSNumber extends COSBase
This class represents an abstract number in a PDF document.
Author:
Ben Litchfield
  • Constructor Details

    • COSNumber

      public COSNumber()
  • Method Details

    • floatValue

      public abstract float floatValue()
      Returns:
      The float value of this object.
    • doubleValue

      public abstract double doubleValue()
      Returns:
      The double value of this number.
    • intValue

      public abstract int intValue()
      Returns:
      The integer value of this number.
    • longValue

      public abstract long longValue()
      Returns:
      The long value of this number.
    • get

      public static COSNumber get(String number) throws IOException
      This factory method will get the appropriate number object.
      Parameters:
      number - The string representation of the number.
      Returns:
      A number object, either float or int.
      Throws:
      IOException - If the string is not a number.
    • idIfAbsent

      public void idIfAbsent(IndirectCOSObjectIdentifier id)
      Description copied from class: COSBase
      Assign an id to this COSBase if it doesn't have one already.
      Overrides:
      idIfAbsent in class COSBase