|
jPod PDF library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.intarsys.pdf.cos.COSDocumentElement
de.intarsys.pdf.cos.COSObject
de.intarsys.pdf.cos.COSCompositeObject
de.intarsys.pdf.cos.COSDictionary
public class COSDictionary
Represents a collection of associations (Map).
The keys of the association are COSName objects, the value may be any COSDocumentElement
| Nested Class Summary | |
|---|---|
static class |
COSDictionary.Entry
|
| Field Summary |
|---|
| Fields inherited from class de.intarsys.pdf.cos.COSObject |
|---|
CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER |
| Method Summary | |
|---|---|
Object |
accept(ICOSObjectVisitor visitor)
Accept a visitor object. |
void |
addAll(COSDictionary dict)
Add all objects from dict. |
void |
addIfAbsent(COSDictionary dict)
Add all values from dict that are not yet defined in the
receiver. |
COSDictionary |
asDictionary()
|
Iterator |
basicEntryIterator()
An iterator over all entries. |
COSDocumentElement |
basicGet(COSName key)
The COSDocumentElement associated with key. |
Iterator |
basicIterator()
An iterator over all values. |
COSDocumentElement |
basicPutSilent(COSName key,
COSDocumentElement element)
Add a document element to the collection. |
COSDocumentElement |
basicRemoveSilent(COSName key)
Remove the element associated with key from the collection . |
void |
clear()
Remove all associations from the receiver. |
boolean |
containsKey(COSName key)
Answer true if key is a valid key in the collection . |
boolean |
containsValue(COSObject obj)
Answer true if obj is contained in the
collection |
COSObject |
copyDeep(Map copied)
Make a deep copy of the receiver within the same document. |
COSObject |
copyShallow()
Make a copy of the receiver. |
static COSDictionary |
create()
Create an empty COSDictionary. |
static COSDictionary |
create(int size)
Create an empty COSDictionary with an initial capacity. |
Iterator |
entryIterator()
An iterator over all entries, returning a collection of COSDictionary.Entry
instances. |
boolean |
equals(Object o)
|
COSObject |
get(COSName key)
The COSObject associated with key. |
Iterator |
iterator()
An iterator over contained objects. |
COSObject |
keyOf(COSObject obj)
The key of obj when it is contained in this or COSNull. |
Set |
keySet()
The set of keys. |
COSObject |
put(COSName key,
COSObject object)
Add an association to the collection. |
COSIndirectObject |
referenceIndirect(COSObject object)
Change the reference to the object contained in this to an indirect one via reference. |
COSObject |
remove(COSName key)
Remove the element from the collection associated with key. |
void |
restoreState(Object object)
|
Object |
saveState()
|
int |
size()
The number of elements in this. |
List |
values()
A list of COSObject instances within this. |
| Methods inherited from class de.intarsys.pdf.cos.COSCompositeObject |
|---|
addObjectListener, associate, containable, copyDeep, disassociate, getAttribute, harden, isObjectListenerAvailable, isPrimitive, mayBeSwapped, referenceCount, register, removeAttribute, removeObjectListener, restoreStateContainer, saveStateContainer, setAttribute, soften, willChange |
| Methods inherited from class de.intarsys.pdf.cos.COSObject |
|---|
asArray, asBoolean, asFixed, asInteger, asName, asNull, asNumber, asStream, asString, beConstant, beIndirect, containable, copyOptional, copySubGraph, dereference, getContainer, getDoc, getIndirectObject, getValueBoolean, getValueBytes, getValueFloat, getValueInteger, getValueString, harden, isDangling, isIndirect, isNull, isNumber, isSwapped, soften, stringValue, toString |
| Methods inherited from class de.intarsys.pdf.cos.COSDocumentElement |
|---|
handleException, isReference |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.intarsys.pdf.cos.ICOSContainer |
|---|
getDoc |
| Method Detail |
|---|
public static COSDictionary create()
COSDictionary.
COSDictionary.public static COSDictionary create(int size)
COSDictionary with an initial capacity.
COSDictionary with an initial capacity.
public Object accept(ICOSObjectVisitor visitor)
throws COSVisitorException
COSDocumentElementvisitor by "double dispatching".
accept in class COSDocumentElementvisitor - The object visiting the receiver.
COSVisitorException - An exception depending on the visitor semantics.public void addAll(COSDictionary dict)
dict. Associations already available
in this are replaced with new content .
dict - The collection of associations to add to this.public void addIfAbsent(COSDictionary dict)
dict that are not yet defined in the
receiver.
dict - The dictionary with the associations to add.public COSDictionary asDictionary()
asDictionary in class COSObjectthis as a COSDictionary or
nullpublic Iterator basicEntryIterator()
public COSDocumentElement basicGet(COSName key)
COSDocumentElement associated with key.
key - The name to lookup
COSDocumentElement associated with key.public Iterator basicIterator()
basicIterator in class COSObject
public COSDocumentElement basicPutSilent(COSName key,
COSDocumentElement element)
The element is inserted without change propagation.
This should not be used by the application level programmer. It is public for package visibility reasons.
key - The key where to store the new element.element - The COSDocumentElement to store.
COSDocumentElement associated with key
so far.public COSDocumentElement basicRemoveSilent(COSName key)
key from the collection .
The element is removed without change propagation.
This should not be used by the application level programmer. It is public for package visibility reasons.
key - The key of the element to be removed
COSDocumentElement removed or null.public void clear()
public boolean containsKey(COSName key)
key is a valid key in the collection .
key - The key whose existence is to be checked.
key is a valid key in the
collection .public boolean containsValue(COSObject obj)
true if obj is contained in the
collection
obj - The object to look up in the collection
true if obj is contained in
the collectionpublic 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 COSCompositeObjectCOSObject.copyDeep()public COSObject copyShallow()
COSObjectA copy is made of the receiver and after this recursively of all not indirect objects.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyShallow in class COSObjectpublic Iterator entryIterator()
COSDictionary.Entry
instances. The COSDictionary.Entry values are dereferenced.
COSDictionary.Entry instances.public boolean equals(Object o)
equals in class Objectpublic COSObject get(COSName key)
COSObject associated with key.
key - The key to lookup
COSObject associated with key.public Iterator iterator()
COSObjectThis iterator returns only COSObject instances, references are dereferenced.
iterator in class COSObjectpublic COSObject keyOf(COSObject obj)
COSNull.
obj - The object to look up in the collection
COSNull.public Set keySet()
COSName instances.
public COSObject put(COSName key,
COSObject object)
key - The key where to store the objectobject - The object to store in the collection
COSObject associated with key so far.public COSIndirectObject referenceIndirect(COSObject object)
COSCompositeObjectThis 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 ICOSContainerreferenceIndirect in class COSCompositeObjectobject - The object to be indirectpublic COSObject remove(COSName key)
key.
key - The key of the object to remove
COSObject removed or null.public void restoreState(Object object)
restoreState in interface de.intarsys.tools.component.ISaveStateSupportrestoreState in class COSObjectpublic Object saveState()
public int size()
public List values()
COSObject instances within this.
COSObject instances within this.
|
jPod PDF library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||