Package com.tom_roush.pdfbox.cos
Class COSNumber
- java.lang.Object
-
- com.tom_roush.pdfbox.cos.COSBase
-
- com.tom_roush.pdfbox.cos.COSNumber
-
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
COSFloat,COSInteger
public abstract class COSNumber extends COSBase
This class represents an abstract number in a PDF document.
-
-
Field Summary
Fields Modifier and Type Field Description static COSIntegerONEDeprecated.Use theCOSInteger.ONEconstant insteadstatic COSIntegerZERODeprecated.Use theCOSInteger.ZEROconstant instead
-
Constructor Summary
Constructors Constructor Description COSNumber()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract doubledoubleValue()This will get the double value of this number.abstract floatfloatValue()This will get the float value of this number.static COSNumberget(String number)This factory method will get the appropriate number object.abstract intintValue()This will get the integer value of this number.abstract longlongValue()This will get the long value of this number.-
Methods inherited from class com.tom_roush.pdfbox.cos.COSBase
accept, getCOSObject, isDirect, setDirect
-
-
-
-
Field Detail
-
ZERO
@Deprecated public static final COSInteger ZERO
Deprecated.Use theCOSInteger.ZEROconstant instead
-
ONE
@Deprecated public static final COSInteger ONE
Deprecated.Use theCOSInteger.ONEconstant instead
-
-
Method Detail
-
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
public static COSNumber get(String number) throws IOException
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.
-
-