Class ASNumber
- java.lang.Object
-
- com.adobe.internal.pdftoolkit.core.types.ASObject
-
- com.adobe.internal.pdftoolkit.core.types.ASNumber
-
public class ASNumber extends ASObject
ASNumber encapulates a number while maintaining the underlying textual representation for the value. That is, it does not convert the string to a value until asked to do so.
-
-
Constructor Summary
Constructors Constructor Description ASNumber(double value)
Constructor.ASNumber(float value)
Constructor.ASNumber(int value)
Constructor.ASNumber(long value)
Constructor.ASNumber(ASNumber value)
Constructor.ASNumber(ASString value)
Constructor which creates a number from string value passed in proper number format.ASNumber(java.lang.Double value)
Constructor.ASNumber(java.lang.Float value)
Constructor.ASNumber(java.lang.Number value)
Constructor.ASNumber(java.lang.String value)
Constructor which creates a number from string value passed in proper number format.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
doubleToString(double value)
Converts the double value passed here to an string and returns it.double
doubleValue()
Returns double value of this number.float
floatValue()
Returns float value of this number.int
intValue()
Returns integer value of this number.long
longValue()
Returns long value of this number.java.lang.Number
numberValue()
Returns this number.ASString
strValue()
Returns string representation of this number object.java.lang.String
toString()
void
write(OutputByteStream outputByteStream)
Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.
-
-
-
Constructor Detail
-
ASNumber
public ASNumber(ASString value) throws PDFParseException
Constructor which creates a number from string value passed in proper number format.- Throws:
PDFParseException
-
ASNumber
public ASNumber(java.lang.String value) throws PDFParseException
Constructor which creates a number from string value passed in proper number format.- Throws:
PDFParseException
-
ASNumber
public ASNumber(ASNumber value)
Constructor.
-
ASNumber
public ASNumber(java.lang.Number value)
Constructor.
-
ASNumber
public ASNumber(java.lang.Float value)
Constructor.
-
ASNumber
public ASNumber(java.lang.Double value)
Constructor.
-
ASNumber
public ASNumber(int value)
Constructor.
-
ASNumber
public ASNumber(long value)
Constructor.
-
ASNumber
public ASNumber(float value)
Constructor.
-
ASNumber
public ASNumber(double value)
Constructor.
-
-
Method Detail
-
strValue
public ASString strValue()
Returns string representation of this number object.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
intValue
public int intValue()
Returns integer value of this number.
-
longValue
public long longValue()
Returns long value of this number.
-
floatValue
public float floatValue()
Returns float value of this number.
-
doubleValue
public double doubleValue()
Returns double value of this number.
-
numberValue
public java.lang.Number numberValue()
Returns this number.
-
doubleToString
public static java.lang.String doubleToString(double value)
Converts the double value passed here to an string and returns it.
-
write
public void write(OutputByteStream outputByteStream) throws PDFIOException
Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.- Specified by:
write
in classASObject
- Parameters:
outputByteStream
- OutputByteStream to write to.- Throws:
PDFIOException
- See Also:
ASString
-
-