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
public final class COSInteger extends COSNumber
This class represents an integer number in a PDF document.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
HIGH
The highest integer to be kept in theSTATIC
array.private static int
LOW
The lowest integer to be kept in theSTATIC
array.static COSInteger
ONE
Constant for the number one.private static COSInteger[]
STATIC
static COSInteger
THREE
Constant for the number three.static COSInteger
TWO
Constant for the number two.private long
value
static COSInteger
ZERO
Constant for the number zero.
-
Constructor Summary
Constructors Modifier Constructor Description private
COSInteger(long val)
constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
accept(ICOSVisitor visitor)
visitor pattern double dispatch method.double
doubleValue()
Deprecated.will be removed in a future releaseboolean
equals(java.lang.Object o)
float
floatValue()
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
longValue()
Polymorphic access to value as int This will get the integer value of this object.java.lang.String
toString()
void
writePDF(java.io.OutputStream output)
This will output this string as a PDF object.-
Methods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, isDirect, setDirect
-
-
-
-
Field Detail
-
LOW
private static final int LOW
The lowest integer to be kept in theSTATIC
array.- See Also:
- Constant Field Values
-
HIGH
private static final int HIGH
The highest integer to be kept in theSTATIC
array.- See Also:
- Constant Field Values
-
STATIC
private static final COSInteger[] STATIC
-
ZERO
public static final COSInteger ZERO
Constant for the number zero.- Since:
- Apache PDFBox 1.1.0
-
ONE
public static final COSInteger ONE
Constant for the number one.- Since:
- Apache PDFBox 1.1.0
-
TWO
public static final COSInteger TWO
Constant for the number two.- Since:
- Apache PDFBox 1.1.0
-
THREE
public static final COSInteger THREE
Constant for the number three.- Since:
- Apache PDFBox 1.1.0
-
value
private final long value
-
-
Method Detail
-
get
public static COSInteger get(long val)
Returns a COSInteger instance with the given value.- Parameters:
val
- integer value- Returns:
- COSInteger instance
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
public java.lang.Object accept(ICOSVisitor visitor) throws java.io.IOException
visitor pattern double dispatch method.
-
writePDF
public void writePDF(java.io.OutputStream output) throws java.io.IOException
This will output this string as a PDF object.- Parameters:
output
- The stream to write to.- Throws:
java.io.IOException
- If there is an error writing to the stream.
-
-