Package com.tom_roush.pdfbox.cos
Class COSInteger
- java.lang.Object
-
- com.tom_roush.pdfbox.cos.COSBase
-
- com.tom_roush.pdfbox.cos.COSNumber
-
- com.tom_roush.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 static COSIntegerONEConstant for the number one.protected static COSIntegerOUT_OF_RANGE_MAXConstant for an out of range value which is bigger than Log.MAX_VALUE.protected static COSIntegerOUT_OF_RANGE_MINConstant for an out of range value which is smaller than Log.MIN_VALUE.static COSIntegerTHREEConstant for the number three.static COSIntegerTWOConstant for the number two.static COSIntegerZEROConstant for the number zero.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Objectaccept(ICOSVisitor visitor)visitor pattern double dispatch method.doubledoubleValue()Deprecated.will be removed in a future releasebooleanequals(Object o)floatfloatValue()polymorphic access to value as float.static COSIntegerget(long val)Returns a COSInteger instance with the given value.inthashCode()intintValue()Polymorphic access to value as int This will get the integer value of this object.booleanisValid()Indicates whether this instance represents a valid value.longlongValue()Polymorphic access to value as int This will get the integer value of this object.StringtoString()voidwritePDF(OutputStream output)This will output this string as a PDF object.-
Methods inherited from class com.tom_roush.pdfbox.cos.COSBase
getCOSObject, isDirect, setDirect
-
-
-
-
Field Detail
-
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
-
OUT_OF_RANGE_MAX
protected static final COSInteger OUT_OF_RANGE_MAX
Constant for an out of range value which is bigger than Log.MAX_VALUE.
-
OUT_OF_RANGE_MIN
protected static final COSInteger OUT_OF_RANGE_MIN
Constant for an out of range value which is smaller than Log.MIN_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
-
floatValue
public float floatValue()
polymorphic access to value as float.- Specified by:
floatValuein 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:
doubleValuein 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.
-
isValid
public boolean isValid()
Indicates whether this instance represents a valid value.- Returns:
- true if the value is valid
-
accept
public Object accept(ICOSVisitor visitor) throws IOException
visitor pattern double dispatch method.- Specified by:
acceptin 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
public void writePDF(OutputStream output) throws IOException
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.
-
-