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).
PdfObject
,
BadPdfFormatException
Constructor and Description |
---|
PdfNumber(double value)
Constructs a new
PdfNumber -object of type real. |
PdfNumber(float value)
Constructs a new
PdfNumber -object of type real. |
PdfNumber(int value)
Constructs a new
PdfNumber -object of type integer. |
PdfNumber(long value)
Constructs a new
PdfNumber -object of type long. |
PdfNumber(String content)
Constructs a
PdfNumber -object. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PdfNumber o) |
double |
doubleValue()
Returns the primitive
double value of this object. |
boolean |
equals(Object o) |
float |
floatValue()
Returns the primitive
float value of this object. |
int |
hashCode() |
void |
increment()
Increments the value of the
PdfNumber -object by 1. |
int |
intValue()
Returns the primitive
int value of this object. |
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, toPdf, toString, type
public PdfNumber(String content)
PdfNumber
-object.content
- value of the new PdfNumber
-objectpublic PdfNumber(int value)
PdfNumber
-object of type integer.value
- value of the new PdfNumber
-objectpublic PdfNumber(long value)
PdfNumber
-object of type long.value
- value of the new PdfNumber
-objectpublic PdfNumber(double value)
PdfNumber
-object of type real.value
- value of the new PdfNumber
-objectpublic PdfNumber(float value)
PdfNumber
-object of type real.value
- value of the new PdfNumber
-objectpublic int intValue()
int
value of this object.int
public double doubleValue()
double
value of this object.double
public float floatValue()
float
value of this object.float
public void increment()
PdfNumber
-object by 1.public int compareTo(PdfNumber o)
compareTo
in interface Comparable<PdfNumber>
Copyright © 2020. All rights reserved.