Package com.aowagie.text.pdf
Class PdfNumber
- java.lang.Object
-
- com.aowagie.text.pdf.PdfObject
-
- com.aowagie.text.pdf.PdfNumber
-
public class PdfNumber extends PdfObject
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:
PdfObject
,BadPdfFormatException
-
-
Field Summary
Fields Modifier and Type Field Description private double
value
actual value of thisPdfNumber
, represented as adouble
-
Fields inherited from class com.aowagie.text.pdf.PdfObject
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type
-
-
Constructor Summary
Constructors Constructor Description PdfNumber(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(java.lang.String content)
Constructs aPdfNumber
-object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue()
Returns the primitivedouble
value of this object.float
floatValue()
Returns the primitivefloat
value of this object.int
intValue()
Returns the primitiveint
value of this object.-
Methods inherited from class com.aowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, setContent, setIndRef, toPdf, toString, type
-
-
-
-
Constructor Detail
-
PdfNumber
public PdfNumber(java.lang.String content)
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
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 Detail
-
intValue
public int intValue()
Returns the primitiveint
value of this object.- Returns:
- The value as
int
-
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
-
-