fop 0.94

org.apache.fop.pdf
Class PDFArray

java.lang.Object
  extended by org.apache.fop.pdf.PDFObject
      extended by org.apache.fop.pdf.PDFArray
All Implemented Interfaces:
PDFWritable

public class PDFArray
extends PDFObject

Class representing an array object.


Field Summary
protected  java.util.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
PDFArray(java.util.Collection values)
          Create the array object
PDFArray(int[] values)
          Create the array object
PDFArray(java.lang.Object[] values)
          Create the array object
 
Method Summary
 void add(java.lang.Object obj)
          Adds a new value to the array.
 java.lang.Object get(int index)
          Gets an entry at a given location.
 int length()
          Returns the length of the array
 void set(int index, java.lang.Object obj)
          Sets an entry at a given location.
 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, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, hasObjectNumber, makeReference, output, referencePDF, setDocument, setObjectNumber, toInlinePDFString, toPDF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

protected java.util.List values
List holding the values of this array

Constructor Detail

PDFArray

public PDFArray()
Create a new, empty array object


PDFArray

public PDFArray(int[] values)
Create the array object

Parameters:
values - the actual array wrapped by this object

PDFArray

public PDFArray(java.util.Collection values)
Create the array object

Parameters:
values - the actual values wrapped by this object

PDFArray

public PDFArray(java.lang.Object[] values)
Create the array object

Parameters:
values - the actual array wrapped by this object
Method Detail

length

public int length()
Returns the length of the array

Returns:
the length of the array

set

public void set(int index,
                java.lang.Object obj)
Sets an entry at a given location.

Parameters:
index - the index of the value to set
obj - the new value

get

public java.lang.Object get(int index)
Gets an entry at a given location.

Parameters:
index - the index of the value to set
Returns:
the requested value

add

public void add(java.lang.Object obj)
Adds a new value to the array.

Parameters:
obj - the value

toPDFString

public 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
Returns:
String the String representation
See Also:
PDFObject.toPDFString()

fop 0.94

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