intarsys PDF library API

de.intarsys.pdf.cos
Class COSPrimitiveObject

java.lang.Object
  extended by de.intarsys.pdf.cos.COSDocumentElement
      extended by de.intarsys.pdf.cos.COSObject
          extended by de.intarsys.pdf.cos.COSPrimitiveObject
All Implemented Interfaces:
ICOSExceptionHandler, de.intarsys.tools.component.ISaveStateSupport
Direct Known Subclasses:
COSBoolean, COSName, COSNull, COSNumber, COSString

public abstract class COSPrimitiveObject
extends COSObject

Primitive COS datatypes. These objects are "immutable" in their PDF semantics. The container may change!


Field Summary
 
Fields inherited from class de.intarsys.pdf.cos.COSObject
CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER
 
Method Summary
 void addObjectListener(ICOSObjectListener listener)
          Add a listener for object changes.
 Iterator basicIterator()
          An iterator over contained objects and references.
 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.
 boolean isDangling()
          true if this object is not contained in a document directly or indirectly.
 boolean isObjectListenerAvailable()
          true if an ICOSObjectListener is registered.
 boolean isPrimitive()
          Answer true if this object is of a primitive type
 Iterator iterator()
          An iterator over contained objects.
 void removeObjectListener(ICOSObjectListener listener)
          Remove a listener for object changes.
 
Methods inherited from class de.intarsys.pdf.cos.COSObject
asArray, asBoolean, asDictionary, asFixed, asInteger, asName, asNull, asNumber, asStream, asString, beConstant, beIndirect, containable, copyOptional, copyShallow, copySubGraph, dereference, getContainer, getDoc, getIndirectObject, isIndirect, isNull, isNumber, isSwapped, restoreState, stringValue, toString
 
Methods inherited from class de.intarsys.pdf.cos.COSDocumentElement
accept, handleException, isReference
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.intarsys.tools.component.ISaveStateSupport
saveState
 

Method Detail

addObjectListener

public void addObjectListener(ICOSObjectListener listener)
Description copied from class: COSObject
Add a listener for object changes.

Specified by:
addObjectListener in class COSObject
Parameters:
listener - The listener to be informed about changes.

basicIterator

public Iterator basicIterator()
Description copied from class: COSObject
An iterator over contained objects and references. The iterator is an empty iterator if this is not a container.

This iterator returns COSDocumentElements, leaving references alone.

Specified by:
basicIterator in class COSObject
Returns:
Iterator over contained objects and references.

copyDeep

public COSObject copyDeep()
Description copied from class: COSObject
Make a deep copy of the receiver within the same document. The result is a "PDF semantic" deep copy, implementation artifacts as "attributes" and listeners are NOT copied.

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.

Specified by:
copyDeep in class COSObject
Returns:
the object copied recursively

copyDeep

public COSObject copyDeep(Map copied)
Description copied from class: COSObject
Make a deep copy of the receiver within the same document. The result is a "PDF semantic" deep copy, implementation artifacts as "attributes" and listeners are NOT copied.

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.

Specified by:
copyDeep in class COSObject
Returns:
the object copied recursively
See Also:
COSObject.copyDeep()

isDangling

public boolean isDangling()
Description copied from class: COSObject
true if this object is not contained in a document directly or indirectly. This is especially true when an object is new (or reset to this state when an undo happend). Remember that an object can still be garbage, even if it is not dangling.

Overrides:
isDangling in class COSObject
Returns:
true if this object is not contained in a document directly or indirectly.

isPrimitive

public boolean isPrimitive()
Description copied from class: COSObject
Answer true if this object is of a primitive type

Specified by:
isPrimitive in class COSObject
Returns:
Answer true if this object is of a primitive type

iterator

public Iterator iterator()
Description copied from class: COSObject
An iterator over contained objects. The iterator is an empty iterator if this is not a container.

This iterator returns only COSObject instances, references are dereferenced.

Specified by:
iterator in class COSObject
Returns:
Iterator over contained objects.

removeObjectListener

public void removeObjectListener(ICOSObjectListener listener)
Description copied from class: COSObject
Remove a listener for object changes.

Specified by:
removeObjectListener in class COSObject
Parameters:
listener - The listener to be removed.

isObjectListenerAvailable

public boolean isObjectListenerAvailable()
Description copied from class: COSObject
true if an ICOSObjectListener is registered. This is for test purposes.

Specified by:
isObjectListenerAvailable in class COSObject

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.