Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.lowagie.text.pdf
Class PdfArray

    java.lang.Object
      com.lowagie.text.pdf.PdfObject
          com.lowagie.text.pdf.PdfArray

Direct Known Subclasses:
  PdfBorderArray, PdfColor, PdfDashPattern, PdfDestination, PdfRectangle

    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 ArrayList` | `arrayList` this is the actual array of PdfObjects

Fields inherited from class com.lowagie.text.pdf.PdfObject
`ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, indRef, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type`

Constructor Summary
`PdfArray()` Constructs an empty `PdfArray`-object.
`PdfArray(float[] values)`
`PdfArray(int[] values)`
`PdfArray(PdfArray array)` Constructs an `PdfArray`-object, containing all the `PdfObject`s in a given `PdfArray`.
`PdfArray(PdfObject object)` Constructs an `PdfArray`-object, containing 1 `PdfObject`.

Method Summary
`boolean` | `add(float[] values)`
`boolean` | `add(int[] values)`
`boolean` | `add(PdfObject object)` Adds a `PdfObject` to the `PdfArray`.
`void` | `addFirst(PdfObject object)` Adds a `PdfObject` to the `PdfArray`.
`boolean` | `contains(PdfObject object)` Checks if the `PdfArray` already contains a certain `PdfObject`.
`ArrayList` | `getArrayList()` Returns an ArrayList containing `PdfObject`s.
`PdfArray` | `getAsArray(int idx)`
`PdfBoolean` | `getAsBoolean(int idx)`
`PdfDictionary` | `getAsDict(int idx)`
`PdfIndirectReference` | `getAsIndirectObject(int idx)`
`PdfName` | `getAsName(int idx)`
`PdfNumber` | `getAsNumber(int idx)`
`PdfStream` | `getAsStream(int idx)`
`PdfString` | `getAsString(int idx)`
`PdfObject` | `getDirectObject(int idx)`
`PdfObject` | `getPdfObject(int idx)`
`ListIterator` | `listIterator()`
`int` | `size()` Returns the number of entries in the array.
`void` | `toPdf(PdfWriter writer, OutputStream os)` Returns the PDF representation of this `PdfArray`.
`String` | `toString()` Returns the `String`-representation of this `PdfObject`.

Methods inherited from class com.lowagie.text.pdf.PdfObject
`canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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 `PdfObject`s in a given `PdfArray`.

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

Method Detail

### toPdf

    public void toPdf(PdfWriter writer,
                      OutputStream os)
               throws IOException

  Returns the PDF representation of this `PdfArray`.

  Overrides:
    `toPdf` in class `PdfObject`
  Parameters:
    `writer` - for backwards compatibility
    `os` - the outputstream to write the bytes to.
  Throws:
    `IOException`

### getArrayList

    public ArrayList getArrayList()

  Returns an ArrayList containing `PdfObject`s.

  Returns:
    an ArrayList

### size

    public int size()

  Returns the number of entries in the array.

  Returns:
    the size of the ArrayList

### 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`

### listIterator

    public ListIterator listIterator()

### toString

    public String toString()

  Description copied from class: `PdfObject`
  Returns the `String`-representation of this `PdfObject`.

  Overrides:
    `toString` in class `PdfObject`
  Returns:
    a `String`

### getPdfObject

    public PdfObject getPdfObject(int idx)

### getDirectObject

    public PdfObject getDirectObject(int idx)

### getAsDict

    public PdfDictionary getAsDict(int idx)

### getAsArray

    public PdfArray getAsArray(int idx)

### getAsStream

    public PdfStream getAsStream(int idx)

### getAsString

    public PdfString getAsString(int idx)

### getAsNumber

    public PdfNumber getAsNumber(int idx)

### getAsName

    public PdfName getAsName(int idx)

### getAsBoolean

    public PdfBoolean getAsBoolean(int idx)

### getAsIndirectObject

    public PdfIndirectReference getAsIndirectObject(int idx)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD