Class PdfNumber

java.lang.Object
com.lowagie.text.pdf.PdfObject
com.lowagie.text.pdf.PdfNumber
All Implemented Interfaces:
Comparable<PdfNumber>

public class PdfNumber extends PdfObject implements Comparable<PdfNumber>
PdfNumber provides two types of numbers, integer and real.

Integers may be specified by signed or unsigned constants. Reals may only be in decimal format.
This object is described in the 'Portable Document Format Reference Manual version 1.7' section 3.3.2 (page 52-53).

See Also:
  • Field Details

    • value

      private double value
      actual value of this PdfNumber, represented as a double
  • Constructor Details

    • PdfNumber

      public PdfNumber(String content)
      Constructs a PdfNumber-object.
      Parameters:
      content - value of the new PdfNumber-object
    • PdfNumber

      public PdfNumber(int value)
      Constructs a new PdfNumber-object of type integer.
      Parameters:
      value - value of the new PdfNumber-object
    • PdfNumber

      public PdfNumber(long value)
      Constructs a new PdfNumber-object of type long.
      Parameters:
      value - value of the new PdfNumber-object
    • PdfNumber

      public PdfNumber(double value)
      Constructs a new PdfNumber-object of type real.
      Parameters:
      value - value of the new PdfNumber-object
    • PdfNumber

      public PdfNumber(float value)
      Constructs a new PdfNumber-object of type real.
      Parameters:
      value - value of the new PdfNumber-object
  • Method Details

    • intValue

      public int intValue()
      Returns the primitive int value of this object.
      Returns:
      The value as int
    • doubleValue

      public double doubleValue()
      Returns the primitive double value of this object.
      Returns:
      The value as double
    • floatValue

      public float floatValue()
      Returns the primitive float value of this object.
      Returns:
      The value as float
    • increment

      public void increment()
      Increments the value of the PdfNumber-object by 1.
    • equals

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

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

      public int compareTo(PdfNumber o)
      Specified by:
      compareTo in interface Comparable<PdfNumber>