intarsys PDF library API

de.intarsys.pdf.cos
Interface ICOSContainer

All Known Implementing Classes:
COSArray, COSCompositeObject, COSDictionary, COSDocument, COSIndirectObject, COSObjectProxy, COSStream

public interface ICOSContainer

A low level interface for polymorphic access to an object containing a COSObject.

This is implemented for example by COSArray.


Method Summary
 ICOSContainer associate(ICOSContainer newContainer, COSObject object)
          It is the responsibility of the current container to create the association with the new one.
 COSDocumentElement containable(COSObject object)
          The stand-in to be used when object should be contained in a container.
 ICOSContainer disassociate(ICOSContainer oldContainer, COSObject object)
          It is the responsibility of the current container to remove the association from the old one.
 COSDocument getDoc()
          The COSDocument instance where the ICOSContainer is contained.
 int referenceCount()
          The number of references to the contained object.
 COSIndirectObject referenceIndirect(COSObject object)
          Switch a contained object to an indirect one.
 void register(COSDocumentElement object)
          It is the responsibility of the active container to register object in its data structures.
 ICOSContainer restoreStateContainer(ICOSContainer container)
          Restore the save state for the container.
 ICOSContainer saveStateContainer()
          Create a save state for the container when saving the COSObject state.
 void willChange(COSObject object)
          Propagate a change from a COSObject down in the hierarchy.
 

Method Detail

associate

ICOSContainer associate(ICOSContainer newContainer,
                        COSObject object)
It is the responsibility of the current container to create the association with the new one. The table shows the available transitions | composite | indirect | | constant | n.a. | n.a. | (always copied before by "containable") null | ok | ok | composite | error | ok | indirect | ok | ok |

Parameters:
newContainer -
object -
Returns:
The resulting ICOSContainer for object

disassociate

ICOSContainer disassociate(ICOSContainer oldContainer,
                           COSObject object)
It is the responsibility of the current container to remove the association from the old one. The table shows the available transitions.
              | composite  | indirect   |
              |
    constant  | n.a.       | n.a.       |
    null      | n.a.       | n.a.       |
    composite | ok         | n.a.       |
    indirect  | ok         | n.a.       |
 

Parameters:
oldContainer -
object -
Returns:
The resulting ICOSContainer for object

containable

COSDocumentElement containable(COSObject object)
The stand-in to be used when object should be contained in a container. This is either the object itself or the COSIndirectObject to it.

Parameters:
object - THe object whose containable is requested.
Returns:
The stand-in to be used when object should be contained in a container.

getDoc

COSDocument getDoc()
The COSDocument instance where the ICOSContainer is contained.

Returns:
The COSDocument instance where the ICOSContainer is contained.

willChange

void willChange(COSObject object)
Propagate a change from a COSObject down in the hierarchy.


referenceCount

int referenceCount()
The number of references to the contained object. This method returns -1 when the value can not be determined (as for indirect objects parsed from a file).

Returns:
The number of references to the contained object.

referenceIndirect

COSIndirectObject referenceIndirect(COSObject object)
Switch a contained object to an indirect one. Update the reference.

Parameters:
object - The object to be indirect

register

void register(COSDocumentElement object)
It is the responsibility of the active container to register object in its data structures.

Parameters:
object - The new object to be registered in the hierarchy.

restoreStateContainer

ICOSContainer restoreStateContainer(ICOSContainer container)
Restore the save state for the container.

Parameters:
container -
Returns:
The "before" state of the receiver.

saveStateContainer

ICOSContainer saveStateContainer()
Create a save state for the container when saving the COSObject state.

Returns:
The save state for the container.

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.