Package com.itextpdf.text.pdf
Class PdfNumber
java.lang.Object
com.itextpdf.text.pdf.PdfObject
com.itextpdf.text.pdf.PdfNumber
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionprivate double
actual value of thisPdfNumber
, represented as adouble
-
Constructor Summary
ConstructorsConstructorDescriptionPdfNumber
(double value) Constructs a newPdfNumber
-object of type real.PdfNumber
(float value) Constructs a newPdfNumber
-object of type real.PdfNumber
(int value) Constructs a newPdfNumber
-object of type integer.PdfNumber
(long value) Constructs a newPdfNumber
-object of type long.Constructs aPdfNumber
-object. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the primitivedouble
value of this object.float
Returns the primitivefloat
value of this object.void
Increments the value of thePdfNumber
-object by 1.int
intValue()
Returns the primitiveint
value of this object.long
Returns the primitivelong
value of this object.Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, toPdf, toString, type
-
Field Details
-
value
private double valueactual value of thisPdfNumber
, represented as adouble
-
-
Constructor Details
-
PdfNumber
Constructs aPdfNumber
-object.- Parameters:
content
- value of the newPdfNumber
-object
-
PdfNumber
public PdfNumber(int value) Constructs a newPdfNumber
-object of type integer.- Parameters:
value
- value of the newPdfNumber
-object
-
PdfNumber
public PdfNumber(long value) Constructs a newPdfNumber
-object of type long.- Parameters:
value
- value of the newPdfNumber
-object
-
PdfNumber
public PdfNumber(double value) Constructs a newPdfNumber
-object of type real.- Parameters:
value
- value of the newPdfNumber
-object
-
PdfNumber
public PdfNumber(float value) Constructs a newPdfNumber
-object of type real.- Parameters:
value
- value of the newPdfNumber
-object
-
-
Method Details
-
intValue
public int intValue()Returns the primitiveint
value of this object.- Returns:
- The value as
int
-
longValue
public long longValue()Returns the primitivelong
value of this object.- Returns:
- The value as
long
-
doubleValue
public double doubleValue()Returns the primitivedouble
value of this object.- Returns:
- The value as
double
-
floatValue
public float floatValue()Returns the primitivefloat
value of this object.- Returns:
- The value as
float
-
increment
public void increment()Increments the value of thePdfNumber
-object by 1.
-