public abstract class COSCompositeObject extends COSObject implements ICOSContainer, de.intarsys.tools.attribute.IAttributeSupport
COSObject
instances.CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER| Modifier and Type | Method and Description |
|---|---|
void |
addObjectListener(ICOSObjectListener listener)
Add a listener for object changes.
|
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.
|
COSObject |
copyDeep()
Make a deep copy of the receiver within the same document.
|
COSObject |
copyDeep(Map copied)
Make a deep copy of the receiver within the same document.
|
ICOSContainer |
disassociate(ICOSContainer oldContainer,
COSObject object)
It is the responsibility of the current container to remove the
association from the old one.
|
Object |
getAttribute(Object key) |
void |
harden(COSObject object)
Propagate up the containment hierarchy
|
boolean |
isObjectListenerAvailable()
true if an ICOSObjectListener is registered. |
boolean |
isPrimitive()
Answer true if this object is of a primitive type
|
boolean |
mayBeSwapped()
true if this object may be swapped from memory by the
garbage collector. |
int |
referenceCount()
The number of references to the contained object.
|
COSIndirectObject |
referenceIndirect(COSObject object)
Change the reference to the object contained in this to an indirect one
via reference.
|
void |
register(COSDocumentElement object)
It is the responsibility of the active container to register object in
its data structures.
|
Object |
removeAttribute(Object key) |
void |
removeObjectListener(ICOSObjectListener listener)
Remove a listener for object changes.
|
ICOSContainer |
restoreStateContainer(ICOSContainer pContainer)
Restore the save state for the container.
|
ICOSContainer |
saveStateContainer()
Create a save state for the container when saving the COSObject state.
|
Object |
setAttribute(Object key,
Object value) |
void |
soften(COSObject object)
Propagate up the containment hierarchy
|
void |
willChange(COSObject change)
Propagate a change from a COSObject down in the hierarchy.
|
asArray, asBoolean, asDictionary, asFixed, asInteger, asName, asNull, asNumber, asStream, asString, basicIterator, beConstant, beIndirect, containable, copyOptional, copyShallow, copySubGraph, dereference, getContainer, getDoc, getIndirectObject, getValueBoolean, getValueBytes, getValueFloat, getValueInteger, getValueString, harden, isDangling, isIndirect, isNull, isNumber, isSwapped, iterator, restoreState, soften, stringValue, toStringaccept, handleException, isReferenceequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDocpublic void addObjectListener(ICOSObjectListener listener)
COSObjectaddObjectListener in class COSObjectlistener - The listener to be informed about changes.public ICOSContainer associate(ICOSContainer newContainer, COSObject object)
ICOSContainer
| composite | indirect |
|
constant | n.a. | n.a. | (always copied before by "containable")
null | ok | ok |
composite | error | ok |
indirect | ok | ok |
associate in interface ICOSContainerICOSContainer for objectpublic COSDocumentElement containable(COSObject object)
ICOSContainercontainable in interface ICOSContainerobject - THe object whose containable is requested.public final COSObject copyDeep()
COSObject
The algorithm copies this along with all outgoing
references (recursively).
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
public COSObject copyDeep(Map copied)
COSObject
The copied map is used to identify objects copied in
earlier runs of this method to avoid duplicating resources used in
different copy targets (for example the pages of a document).
copied is modified while executing copyDeep
and contains a mapping from indirect objects in the original document to
copied objects.
The algorithm copies this along with all outgoing
references (recursively).
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyDeep in class COSObjectCOSObject.copyDeep()public ICOSContainer disassociate(ICOSContainer oldContainer, COSObject object)
ICOSContainer
| composite | indirect |
|
constant | n.a. | n.a. |
null | n.a. | n.a. |
composite | ok | n.a. |
indirect | ok | n.a. |
disassociate in interface ICOSContainerICOSContainer for objectpublic final Object getAttribute(Object key)
getAttribute in interface de.intarsys.tools.attribute.IAttributeSupportpublic void harden(COSObject object)
harden in interface ICOSContainerobject - The object that should be kept in memory.ICOSContainer.harden(de.intarsys.pdf.cos.COSObject)public boolean isObjectListenerAvailable()
COSObjecttrue if an ICOSObjectListener is registered. This
is for test purposes.isObjectListenerAvailable in class COSObjectpublic boolean isPrimitive()
COSObjectisPrimitive in class COSObjectpublic boolean mayBeSwapped()
COSObjecttrue if this object may be swapped from memory by the
garbage collector.mayBeSwapped in class COSObjecttrue if this object may be swapped from memory by
the garbage collector.public int referenceCount()
ICOSContainerreferenceCount in interface ICOSContainerpublic COSIndirectObject referenceIndirect(COSObject object)
This method must be redefined by all containers to reflect the new reference type in their child references.
This event is delegated to the document to create the correct state for a new indirect object. If a document is not yet present, the state is changed when the COSObject (s) are added to the document finally. This can happen when constructing a COSObject graph "offline" and later add it to the document.
From the COS invariants you can be sure that the object referenced by ref is contained in this at most once
referenceIndirect in interface ICOSContainerobject - public void register(COSDocumentElement object)
ICOSContainerregister in interface ICOSContainerobject - The new object to be registered in the hierarchy.public final Object removeAttribute(Object key)
removeAttribute in interface de.intarsys.tools.attribute.IAttributeSupportpublic void removeObjectListener(ICOSObjectListener listener)
COSObjectremoveObjectListener in class COSObjectlistener - The listener to be removed.public ICOSContainer restoreStateContainer(ICOSContainer pContainer)
ICOSContainerrestoreStateContainer in interface ICOSContainerpublic ICOSContainer saveStateContainer()
ICOSContainersaveStateContainer in interface ICOSContainerpublic final Object setAttribute(Object key, Object value)
setAttribute in interface de.intarsys.tools.attribute.IAttributeSupportpublic void soften(COSObject object)
soften in interface ICOSContainerobject - The object that should be kept in memory.ICOSContainer.soften(de.intarsys.pdf.cos.COSObject)public void willChange(COSObject change)
ICOSContainerwillChange in interface ICOSContainerCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.