org.apache.fop.pdf

Class PDFArray

Implemented Interfaces:
PDFWritable

public class PDFArray
extends PDFObject

Class representing an array object.

Field Summary

protected List
values
List holding the values of this array

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

DATE_FORMAT, log

Constructor Summary

PDFArray()
Create a new, empty array object with no parent.
PDFArray(PDFObject parent)
Create a new, empty array object
PDFArray(PDFObject parent, Collection values)
Create an array object.
PDFArray(PDFObject parent, Object[] values)
Create the array object
PDFArray(PDFObject parent, double[] values)
Create an array object.
PDFArray(PDFObject parent, int[] values)
Create an array object.

Method Summary

void
add(Object obj)
Adds a new value to the array.
void
add(double value)
Adds a new value to the array.
Object
get(int index)
Gets an entry at a given location.
int
length()
Returns the length of the array
protected int
output(OutputStream stream)
void
set(int index, Object obj)
Sets an entry at a given location.
void
set(int index, double value)
Sets an entry at a given location.

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

encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF, toPDFString

Field Details

values

protected List values
List holding the values of this array

Constructor Details

PDFArray

public PDFArray()
Create a new, empty array object with no parent.

PDFArray

public PDFArray(PDFObject parent)
Create a new, empty array object
Parameters:
parent - the array's parent if any

PDFArray

public PDFArray(PDFObject parent,
                Collection values)
Create an array object.
Parameters:
parent - the array's parent if any
values - the actual values wrapped by this object

PDFArray

public PDFArray(PDFObject parent,
                Object[] values)
Create the array object
Parameters:
parent - the array's parent if any
values - the actual array wrapped by this object

PDFArray

public PDFArray(PDFObject parent,
                double[] values)
Create an array object.
Parameters:
parent - the array's parent if any
values - the actual array wrapped by this object

PDFArray

public PDFArray(PDFObject parent,
                int[] values)
Create an array object.
Parameters:
parent - the array's parent if any
values - the actual array wrapped by this object

Method Details

add

public void add(Object obj)
Adds a new value to the array.
Parameters:
obj - the value

add

public void add(double value)
Adds a new value to the array.
Parameters:
value - the value

get

public Object get(int index)
Gets an entry at a given location.
Parameters:
index - the index of the value to set
Returns:
the requested value

length

public int length()
Returns the length of the array
Returns:
the length of the array

output

protected int output(OutputStream stream)
            throws IOException
Overrides:
output in interface PDFObject

set

public void set(int index,
                Object obj)
Sets an entry at a given location.
Parameters:
index - the index of the value to set
obj - the new value

set

public void set(int index,
                double value)
Sets an entry at a given location.
Parameters:
index - the index of the value to set
value - the new value

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