java.lang.Object
com.adobe.internal.pdftoolkit.core.types.ASObject
com.adobe.internal.pdftoolkit.core.types.ASNumber

public class ASNumber extends ASObject
ASNumber encapulates a number while maintaining the underlying textual representation for the value. That is, it does not convert the string to a value until asked to do so.
  • Constructor Details

    • ASNumber

      public ASNumber(ASString value) throws PDFParseException
      Constructor which creates a number from string value passed in proper number format.
      Throws:
      PDFParseException
    • ASNumber

      public ASNumber(String value) throws PDFParseException
      Constructor which creates a number from string value passed in proper number format.
      Throws:
      PDFParseException
    • ASNumber

      public ASNumber(ASNumber value)
      Constructor.
    • ASNumber

      public ASNumber(Number value)
      Constructor.
    • ASNumber

      public ASNumber(Float value)
      Constructor.
    • ASNumber

      public ASNumber(Double value)
      Constructor.
    • ASNumber

      public ASNumber(int value)
      Constructor.
    • ASNumber

      public ASNumber(long value)
      Constructor.
    • ASNumber

      public ASNumber(float value)
      Constructor.
    • ASNumber

      public ASNumber(double value)
      Constructor.
  • Method Details

    • strValue

      public ASString strValue()
      Returns string representation of this number object.
    • toString

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

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

      public long longValue()
      Returns long value of this number.
    • floatValue

      public float floatValue()
      Returns float value of this number.
    • doubleValue

      public double doubleValue()
      Returns double value of this number.
    • numberValue

      public Number numberValue()
      Returns this number.
    • doubleToString

      public static String doubleToString(double value)
      Converts the double value passed here to an string and returns it.
    • write

      public void write(OutputByteStream outputByteStream) throws PDFIOException
      Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.
      Specified by:
      write in class ASObject
      Parameters:
      outputByteStream - OutputByteStream to write to.
      Throws:
      PDFIOException
      See Also: