Package org.apache.pdfbox.cos
Class COSInteger
java.lang.Object
org.apache.pdfbox.cos.COSBase
org.apache.pdfbox.cos.COSNumber
org.apache.pdfbox.cos.COSInteger
- All Implemented Interfaces:
COSObjectable
This class represents an integer number in a PDF document.
- Author:
- Ben Litchfield
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final COSInteger
Constant for the number one.static final COSInteger
Constant for the number three.static final COSInteger
Constant for the number two.static final COSInteger
Constant for the number zero. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(ICOSVisitor visitor) visitor pattern double dispatch method.double
Deprecated.will be removed in a future releaseboolean
float
polymorphic access to value as float.static COSInteger
get
(long val) Returns a COSInteger instance with the given value.int
hashCode()
int
intValue()
Polymorphic access to value as int This will get the integer value of this object.long
Polymorphic access to value as int This will get the integer value of this object.toString()
void
writePDF
(OutputStream output) This will output this string as a PDF object.Methods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, isDirect, setDirect
-
Field Details
-
ZERO
Constant for the number zero.- Since:
- Apache PDFBox 1.1.0
-
ONE
Constant for the number one.- Since:
- Apache PDFBox 1.1.0
-
TWO
Constant for the number two.- Since:
- Apache PDFBox 1.1.0
-
THREE
Constant for the number three.- Since:
- Apache PDFBox 1.1.0
-
-
Method Details
-
get
Returns a COSInteger instance with the given value.- Parameters:
val
- integer value- Returns:
- COSInteger instance
-
equals
-
hashCode
public int hashCode() -
toString
-
floatValue
public float floatValue()polymorphic access to value as float.- Specified by:
floatValue
in classCOSNumber
- Returns:
- The float value of this object.
-
doubleValue
public double doubleValue()Deprecated.will be removed in a future releasepolymorphic access to value as float.- Specified by:
doubleValue
in classCOSNumber
- Returns:
- The double value of this object.
-
intValue
public int intValue()Polymorphic access to value as int This will get the integer value of this object. -
longValue
public long longValue()Polymorphic access to value as int This will get the integer value of this object. -
accept
visitor pattern double dispatch method.- Specified by:
accept
in classCOSBase
- Parameters:
visitor
- The object to notify when visiting this object.- Returns:
- any object, depending on the visitor implementation, or null
- Throws:
IOException
- If an error occurs while visiting this object.
-
writePDF
This will output this string as a PDF object.- Parameters:
output
- The stream to write to.- Throws:
IOException
- If there is an error writing to the stream.
-