org.apache.fop.pdf
Class PDFNumber
java.lang.Object
|
+--org.apache.fop.pdf.PDFObject
|
+--org.apache.fop.pdf.PDFNumber
- public class PDFNumber
- extends PDFObject
This class represents a simple number object. It also contains contains some
utility methods for outputing numbers to PDF.
Method Summary |
static java.lang.String |
doubleOut(double doubleDown)
Output a double value to a string suitable for PDF (6 decimal digits). |
static java.lang.String |
doubleOut(java.lang.Double doubleDown)
Output a Double value to a string suitable for PDF. |
static java.lang.String |
doubleOut(double doubleDown,
int dec)
Output a double value to a string suitable for PDF. |
java.lang.Number |
getNumber()
Returns the number. |
void |
setNumber(java.lang.Number number)
Sets the number. |
protected java.lang.String |
toPDFString()
This method returns a String representation of the PDF object. |
Methods inherited from class org.apache.fop.pdf.PDFObject |
encode, encodeString, encodeText, formatDateTime, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, hasObjectNumber, output, referencePDF, setDocument, setObjectNumber, toPDF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PDFNumber
public PDFNumber()
getNumber
public java.lang.Number getNumber()
- Returns the number.
- Returns:
- the number
setNumber
public void setNumber(java.lang.Number number)
- Sets the number.
- Parameters:
number
- the number
doubleOut
public static java.lang.String doubleOut(java.lang.Double doubleDown)
- Output a Double value to a string suitable for PDF.
- Parameters:
doubleDown
- the Double value- Returns:
- the value as a string
doubleOut
public static java.lang.String doubleOut(double doubleDown)
- Output a double value to a string suitable for PDF (6 decimal digits).
- Parameters:
doubleDown
- the double value- Returns:
- the value as a string
doubleOut
public static java.lang.String doubleOut(double doubleDown,
int dec)
- Output a double value to a string suitable for PDF.
In this method it is possible to set the maximum
number of decimal places to output.
- Parameters:
doubleDown
- the Double valuedec
- the number of decimal places to output- Returns:
- the value as a string
toPDFString
protected java.lang.String toPDFString()
- Description copied from class:
PDFObject
- This method returns a String representation of the PDF object. The result
is normally converted/encoded to a byte array by toPDF(). Only use
this method to implement the serialization if the object can be fully
represented as text. If the PDF representation of the object contains
binary content use toPDF() or output(OutputStream) instead.
- Overrides:
toPDFString
in class PDFObject
- See Also:
PDFObject.toPDFString()
Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.