PDF Clown
0.0.8

it.stefanochizzolini.clown.files
Class IndirectObjects

java.lang.Object
  extended by it.stefanochizzolini.clown.files.IndirectObjects
All Implemented Interfaces:
Iterable<PdfIndirectObject>, Collection<PdfIndirectObject>, List<PdfIndirectObject>

public class IndirectObjects
extends Object
implements List<PdfIndirectObject>

Collection of the alive indirect objects available inside the file.

Remarks

According to the PDF spec, indirect object entries may be free (no data object associated) or in-use (data object associated).

We can effectively subdivide indirect objects in two possibly-overriding collections: the original indirect objects (coming from the associated preexisting file) and the newly-registered indirect objects (coming from new data objects or original indirect objects manipulated during the current session).

To ensure that the modifications applied to an original indirect object are committed to being persistent is critical that the modified original indirect object is newly-registered (practically overriding the original indirect object).

Alive indirect objects encompass all the newly-registered ones plus not-overridden original ones.

Since:
0.0.0
Version:
0.0.8
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Method Summary
 void add(int index, PdfIndirectObject object)
           
 PdfIndirectObject add(PdfDataObject object)
          Register an internal data object.
 boolean add(PdfIndirectObject object)
          Registers an external indirect object.
 boolean addAll(Collection<? extends PdfIndirectObject> objects)
          Registers external indirect objects.
 boolean addAll(int index, Collection<? extends PdfIndirectObject> objects)
           
 Collection<? extends PdfIndirectObject> addAllExternal(Collection<? extends PdfIndirectObject> objects)
           
 PdfIndirectObject addExternal(PdfIndirectObject object)
          Registers and gets an external indirect object.
 void clear()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection<?> objects)
           
 boolean equals(Object object)
           
 PdfIndirectObject get(int index)
          Gets an indirect object with the specified object number.
 File getFile()
           
 TreeMap<Integer,PdfIndirectObject> getModifiedObjects()
          For internal use only.
 int hashCode()
           
 int indexOf(Object object)
           
 boolean isEmpty()
           
 Iterator<PdfIndirectObject> iterator()
           
 int lastIndexOf(Object object)
           
 ListIterator<PdfIndirectObject> listIterator()
           
 ListIterator<PdfIndirectObject> listIterator(int index)
           
 PdfIndirectObject remove(int index)
           
 boolean remove(Object object)
           
 boolean removeAll(Collection<?> objects)
           
 boolean retainAll(Collection<?> objects)
           
 PdfIndirectObject set(int index, PdfIndirectObject object)
          Sets an indirect object with the specified object number.
 int size()
          Gets the number of entries available (both in-use and free) in the collection.
 List<PdfIndirectObject> subList(int fromIndex, int toIndex)
           
 PdfIndirectObject[] toArray()
           
<T> T[]
toArray(T[] objects)
           
 PdfIndirectObject update(PdfIndirectObject object)
          For internal use only.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFile

public File getFile()

add

public PdfIndirectObject add(PdfDataObject object)
Register an internal data object.

Remarks

Alternatives:


addExternal

public PdfIndirectObject addExternal(PdfIndirectObject object)
Registers and gets an external indirect object.

Remarks

External indirect objects come from alien PDF files. This is a powerful way to import the content of one file into another.

Alternatives:


addAllExternal

public Collection<? extends PdfIndirectObject> addAllExternal(Collection<? extends PdfIndirectObject> objects)

add

public void add(int index,
                PdfIndirectObject object)
Specified by:
add in interface List<PdfIndirectObject>

addAll

public boolean addAll(int index,
                      Collection<? extends PdfIndirectObject> objects)
Specified by:
addAll in interface List<PdfIndirectObject>

get

public PdfIndirectObject get(int index)
Gets an indirect object with the specified object number.

Specified by:
get in interface List<PdfIndirectObject>
Parameters:
index - Object number of the indirect object to get.
Returns:
Indirect object corresponding to the specified object number.

indexOf

public int indexOf(Object object)
Specified by:
indexOf in interface List<PdfIndirectObject>

lastIndexOf

public int lastIndexOf(Object object)
Specified by:
lastIndexOf in interface List<PdfIndirectObject>

listIterator

public ListIterator<PdfIndirectObject> listIterator()
Specified by:
listIterator in interface List<PdfIndirectObject>

listIterator

public ListIterator<PdfIndirectObject> listIterator(int index)
Specified by:
listIterator in interface List<PdfIndirectObject>

remove

public PdfIndirectObject remove(int index)
Specified by:
remove in interface List<PdfIndirectObject>

set

public PdfIndirectObject set(int index,
                             PdfIndirectObject object)
Sets an indirect object with the specified object number.

Contract

Remarks

This method is currently limited to internal indirect objects: use it to register modified internal indirect objects only. If you need to register alternative-type objects, consider the following methods:

Specified by:
set in interface List<PdfIndirectObject>
Parameters:
index - Object number of the indirect object to set.
object - Indirect object to set.
Returns:
Replaced indirect object.

subList

public List<PdfIndirectObject> subList(int fromIndex,
                                       int toIndex)
Specified by:
subList in interface List<PdfIndirectObject>

add

public boolean add(PdfIndirectObject object)
Registers an external indirect object.

Remarks

External indirect objects come from alien PDF files. This is a powerful way to import the content of one file into another.

Alternatives:

Specified by:
add in interface Collection<PdfIndirectObject>
Specified by:
add in interface List<PdfIndirectObject>

addAll

public boolean addAll(Collection<? extends PdfIndirectObject> objects)
Registers external indirect objects.

Remarks

External indirect objects come from alien PDF files. This is a powerful way to import the content of one file into another.

Alternatives:

Specified by:
addAll in interface Collection<PdfIndirectObject>
Specified by:
addAll in interface List<PdfIndirectObject>

clear

public void clear()
Specified by:
clear in interface Collection<PdfIndirectObject>
Specified by:
clear in interface List<PdfIndirectObject>

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection<PdfIndirectObject>
Specified by:
contains in interface List<PdfIndirectObject>

containsAll

public boolean containsAll(Collection<?> objects)
Specified by:
containsAll in interface Collection<PdfIndirectObject>
Specified by:
containsAll in interface List<PdfIndirectObject>

equals

public boolean equals(Object object)
Specified by:
equals in interface Collection<PdfIndirectObject>
Specified by:
equals in interface List<PdfIndirectObject>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<PdfIndirectObject>
Specified by:
hashCode in interface List<PdfIndirectObject>
Overrides:
hashCode in class Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<PdfIndirectObject>
Specified by:
isEmpty in interface List<PdfIndirectObject>

remove

public boolean remove(Object object)
Specified by:
remove in interface Collection<PdfIndirectObject>
Specified by:
remove in interface List<PdfIndirectObject>
Since:
0.0.0

removeAll

public boolean removeAll(Collection<?> objects)
Specified by:
removeAll in interface Collection<PdfIndirectObject>
Specified by:
removeAll in interface List<PdfIndirectObject>

retainAll

public boolean retainAll(Collection<?> objects)
Specified by:
retainAll in interface Collection<PdfIndirectObject>
Specified by:
retainAll in interface List<PdfIndirectObject>

size

public int size()
Gets the number of entries available (both in-use and free) in the collection.

Specified by:
size in interface Collection<PdfIndirectObject>
Specified by:
size in interface List<PdfIndirectObject>
Returns:
The number of entries available in the collection.

toArray

public PdfIndirectObject[] toArray()
Specified by:
toArray in interface Collection<PdfIndirectObject>
Specified by:
toArray in interface List<PdfIndirectObject>

toArray

public <T> T[] toArray(T[] objects)
Specified by:
toArray in interface Collection<PdfIndirectObject>
Specified by:
toArray in interface List<PdfIndirectObject>

iterator

public Iterator<PdfIndirectObject> iterator()
Specified by:
iterator in interface Iterable<PdfIndirectObject>
Specified by:
iterator in interface Collection<PdfIndirectObject>
Specified by:
iterator in interface List<PdfIndirectObject>

getModifiedObjects

public TreeMap<Integer,PdfIndirectObject> getModifiedObjects()
For internal use only.


update

public PdfIndirectObject update(PdfIndirectObject object)
For internal use only.


PDF Clown
0.0.8

Project home page

Copyright © 2006-2010 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.