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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intThe highest integer to be kept in theSTATICarray.private final booleanprivate static final intThe lowest integer to be kept in theSTATICarray.static final COSIntegerConstant for the number one.protected static final COSIntegerConstant for an out of range value which is bigger than Log.MAX_VALUE.protected static final COSIntegerConstant for an out of range value which is smaller than Log.MIN_VALUE.private static final COSInteger[]static final COSIntegerConstant for the number three.static final COSIntegerConstant for the number two.private final longstatic final COSIntegerConstant for the number zero. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept(ICOSVisitor visitor) visitor pattern double dispatch method.doubleDeprecated.will be removed in a future releasebooleanfloatpolymorphic access to value as float.static COSIntegerget(long val) Returns a COSInteger instance with the given value.private static COSIntegergetInvalid(boolean maxValue) 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.longPolymorphic access to value as int This will get the integer value of this object.toString()voidwritePDF(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
-
LOW
private static final int LOWThe lowest integer to be kept in theSTATICarray.- See Also:
-
HIGH
private static final int HIGHThe highest integer to be kept in theSTATICarray.- See Also:
-
STATIC
-
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
-
OUT_OF_RANGE_MAX
Constant for an out of range value which is bigger than Log.MAX_VALUE. -
OUT_OF_RANGE_MIN
Constant for an out of range value which is smaller than Log.MIN_VALUE. -
value
private final long value -
isValid
private final boolean isValid
-
-
Constructor Details
-
COSInteger
private COSInteger(long val, boolean valid) constructor.- Parameters:
val- The integer value of this object.
-
-
Method Details
-
get
Returns a COSInteger instance with the given value.- Parameters:
val- integer value- Returns:
- COSInteger instance
-
getInvalid
-
equals
-
hashCode
public int hashCode() -
toString
-
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
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
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.
-