public class COSDictionary extends COSCompositeObject
The keys of the association are COSName objects, the value may be any COSDocumentElement
| Modifier and Type | Class and Description |
|---|---|
static class |
COSDictionary.Entry |
CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER| Modifier and Type | Method and Description |
|---|---|
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<COSObject> |
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. |
addObjectListener, associate, containable, copyDeep, disassociate, getAttribute, harden, isObjectListenerAvailable, isPrimitive, mayBeSwapped, referenceCount, register, removeAttribute, removeObjectListener, restoreStateContainer, saveStateContainer, setAttribute, soften, willChangeasArray, 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, toStringhandleException, isReferencegetClass, hashCode, notify, notifyAll, wait, wait, waitgetDocpublic 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 lookupCOSDocumentElement associated with key.public Iterator basicIterator()
basicIterator in class COSObjectpublic 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 removedCOSDocumentElement 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
collectionobj - The object to look up in the collectiontrue 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 COSObject get(COSName key)
COSObject associated with key.key - The key to lookupCOSObject associated with key.public Iterator<COSObject> iterator()
COSObjectThis iterator returns only COSObject instances, references are dereferenced.
public COSObject keyOf(COSObject obj)
COSNull.obj - The object to look up in the collectionCOSNull.public COSObject put(COSName key, COSObject object)
key - The key where to store the objectobject - The object to store in the collectionCOSObject 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 removeCOSObject removed or null.public void restoreState(Object object)
restoreState in interface de.intarsys.tools.component.ISaveStateSupportrestoreState in class COSObjectpublic Object saveState()
public int size()
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.