Package org.apache.pdfbox.cos
Class COSNumber
java.lang.Object
org.apache.pdfbox.cos.COSBase
org.apache.pdfbox.cos.COSNumber
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
COSFloat
,COSInteger
This class represents an abstract number in a PDF document.
- Version:
- $Revision: 1.10 $
- Author:
- Ben Litchfield
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final COSInteger
Deprecated.static final COSInteger
Deprecated.Use theCOSInteger.ZERO
constant instead -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract double
This will get the double value of this number.abstract float
This will get the float value of this number.static COSNumber
This factory method will get the appropriate number object.abstract int
intValue()
This will get the integer value of this number.abstract long
This will get the long value of this number.Methods inherited from class org.apache.pdfbox.cos.COSBase
accept, getCOSObject, getFilterManager, isDirect, isNeedToBeUpdate, setDirect, setNeedToBeUpdate
-
Field Details
-
ZERO
Deprecated.Use theCOSInteger.ZERO
constant instead -
ONE
Deprecated.Use theCOSInteger.ONE
constant instead
-
-
Constructor Details
-
COSNumber
public COSNumber()
-
-
Method Details
-
floatValue
public abstract float floatValue()This will get the float value of this number.- Returns:
- The float value of this object.
-
doubleValue
public abstract double doubleValue()This will get the double value of this number.- Returns:
- The double value of this number.
-
intValue
public abstract int intValue()This will get the integer value of this number.- Returns:
- The integer value of this number.
-
longValue
public abstract long longValue()This will get the long value of this number.- Returns:
- The long value of this number.
-
get
This factory method will get the appropriate number object.- Parameters:
number
- The string representation of the number.- Returns:
- A number object, either float or int.
- Throws:
IOException
- If the string is not a number.
-
COSInteger.ONE
constant instead