org.apache.fop.pdf

Class PDFNumber

Implemented Interfaces:
PDFWritable

public class PDFNumber
extends PDFObject

This class represents a simple number object. It also contains contains some utility methods for outputing numbers to PDF.

Field Summary

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Method Summary

static String
doubleOut(Double doubleDown)
Output a Double value to a string suitable for PDF.
static String
doubleOut(double doubleDown)
Output a double value to a string suitable for PDF (6 decimal digits).
static String
doubleOut(double doubleDown, int dec)
Output a double value to a string suitable for PDF.
Number
getNumber()
Returns the number.
void
setNumber(Number number)
Sets the number.
protected String
toPDFString()

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeString, encodeText, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, hasObjectNumber, makeReference, output, referencePDF, setDocument, setObjectNumber, toInlinePDFString, toPDF, toPDFString

Method Details

doubleOut

public static String doubleOut(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 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 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 value
dec - the number of decimal places to output
Returns:
the value as a string

getNumber

public Number getNumber()
Returns the number.
Returns:
the number

setNumber

public void setNumber(Number number)
Sets the number.
Parameters:
number - the number

toPDFString

protected String toPDFString()
Overrides:
toPDFString in interface PDFObject

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.