com.lowagie.text.pdf

Class PdfArray

public class PdfArray extends PdfObject

PdfArray is the PDF Array object.

An array is a sequence of PDF objects. An array may contain a mixture of object types. An array is written as a left square bracket ([), followed by a sequence of objects, followed by a right square bracket (]).
This object is described in the 'Portable Document Format Reference Manual version 1.7' section 3.2.5 (page 58).

See Also: PdfObject

Field Summary
protected ArrayListarrayList
this is the actual array of PdfObjects
Constructor Summary
PdfArray()
Constructs an empty PdfArray-object.
PdfArray(PdfObject object)
Constructs an PdfArray-object, containing 1 PdfObject.
PdfArray(float[] values)
PdfArray(int[] values)
PdfArray(PdfArray array)
Constructs an PdfArray-object, containing all the PdfObjects in a given PdfArray.
Method Summary
booleanadd(PdfObject object)
Adds a PdfObject to the PdfArray.
booleanadd(float[] values)
booleanadd(int[] values)
voidaddFirst(PdfObject object)
Adds a PdfObject to the PdfArray.
booleancontains(PdfObject object)
Checks if the PdfArray already contains a certain PdfObject.
ArrayListgetArrayList()
Returns an ArrayList containing PdfObjects.
PdfArraygetAsArray(int idx)
PdfBooleangetAsBoolean(int idx)
PdfDictionarygetAsDict(int idx)
PdfIndirectReferencegetAsIndirectObject(int idx)
PdfNamegetAsName(int idx)
PdfNumbergetAsNumber(int idx)
PdfStreamgetAsStream(int idx)
PdfStringgetAsString(int idx)
PdfObjectgetDirectObject(int idx)
PdfObjectgetPdfObject(int idx)
ListIteratorlistIterator()
intsize()
Returns the number of entries in the array.
voidtoPdf(PdfWriter writer, OutputStream os)
Returns the PDF representation of this PdfArray.
StringtoString()

Field Detail

arrayList

protected ArrayList arrayList
this is the actual array of PdfObjects

Constructor Detail

PdfArray

public PdfArray()
Constructs an empty PdfArray-object.

PdfArray

public PdfArray(PdfObject object)
Constructs an PdfArray-object, containing 1 PdfObject.

Parameters: object a PdfObject that has to be added to the array

PdfArray

public PdfArray(float[] values)

PdfArray

public PdfArray(int[] values)

PdfArray

public PdfArray(PdfArray array)
Constructs an PdfArray-object, containing all the PdfObjects in a given PdfArray.

Parameters: array a PdfArray that has to be added to the array

Method Detail

add

public boolean add(PdfObject object)
Adds a PdfObject to the PdfArray.

Parameters: object PdfObject to add

Returns: true

add

public boolean add(float[] values)

add

public boolean add(int[] values)

addFirst

public void addFirst(PdfObject object)
Adds a PdfObject to the PdfArray.

The newly added object will be the first element in the ArrayList.

Parameters: object PdfObject to add

contains

public boolean contains(PdfObject object)
Checks if the PdfArray already contains a certain PdfObject.

Parameters: object PdfObject to check

Returns: true

getArrayList

public ArrayList getArrayList()
Returns an ArrayList containing PdfObjects.

Returns: an ArrayList

getAsArray

public PdfArray getAsArray(int idx)

getAsBoolean

public PdfBoolean getAsBoolean(int idx)

getAsDict

public PdfDictionary getAsDict(int idx)

getAsIndirectObject

public PdfIndirectReference getAsIndirectObject(int idx)

getAsName

public PdfName getAsName(int idx)

getAsNumber

public PdfNumber getAsNumber(int idx)

getAsStream

public PdfStream getAsStream(int idx)

getAsString

public PdfString getAsString(int idx)

getDirectObject

public PdfObject getDirectObject(int idx)

getPdfObject

public PdfObject getPdfObject(int idx)

listIterator

public ListIterator listIterator()

size

public int size()
Returns the number of entries in the array.

Returns: the size of the ArrayList

toPdf

public void toPdf(PdfWriter writer, OutputStream os)
Returns the PDF representation of this PdfArray.

toString

public String toString()