PDF Clown
0.1.2

org.pdfclown.objects
Class PdfDictionary

java.lang.Object
  extended by org.pdfclown.objects.PdfObject
      extended by org.pdfclown.objects.PdfDataObject
          extended by org.pdfclown.objects.PdfDirectObject
              extended by org.pdfclown.objects.PdfDictionary
All Implemented Interfaces:
Cloneable, Comparable<PdfDirectObject>, Map<PdfName,PdfDirectObject>, IVisitable

public final class PdfDictionary
extends PdfDirectObject
implements Map<PdfName,PdfDirectObject>

PDF dictionary object [PDF:1.6:3.2.6].

Since:
0.0.0
Version:
0.1.2, 12/28/12
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
PdfDictionary()
           
PdfDictionary(int capacity)
           
PdfDictionary(Map<PdfName,PdfDirectObject> entries)
           
PdfDictionary(PdfName[] keys, PdfDirectObject[] values)
           
 
Method Summary
 PdfObject accept(IVisitor visitor, Object data)
          Accepts a visit.
 void clear()
           
 PdfDictionary clone(File context)
          Creates a deep copy of this object within the specified file context.
 int compareTo(PdfDirectObject obj)
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<PdfName,PdfDirectObject>> entrySet()
           
 boolean equals(Object object)
           
 PdfDirectObject get(Object key)
           
<T extends PdfDataObject>
PdfDirectObject
get(PdfName key, Class<T> valueClass)
          Gets the value corresponding to the given key, forcing its instantiation as a direct object in case of missing entry.
<T extends PdfDataObject>
PdfDirectObject
get(PdfName key, Class<T> valueClass, boolean direct)
          Gets the value corresponding to the given key, forcing its instantiation in case of missing entry.
 PdfName getKey(PdfDirectObject value)
          Gets the key associated to the specified value.
 PdfObject getParent()
          Gets the parent of this object.
 int hashCode()
           
 boolean isEmpty()
           
 boolean isUpdateable()
          Gets whether the detection of object state changes is enabled.
 boolean isUpdated()
          Gets whether the initial state of this object has been modified.
protected  boolean isVirtual()
          Gets whether this object acts like a null-object placeholder.
 Set<PdfName> keySet()
           
 PdfDirectObject put(PdfName key, PdfDirectObject value)
           
 void putAll(Map<? extends PdfName,? extends PdfDirectObject> entries)
           
 PdfDirectObject remove(Object key)
           
 PdfDataObject resolve(PdfName key)
          Gets the dereferenced value corresponding to the given key.
<T extends PdfDataObject>
T
resolve(PdfName key, Class<T> valueClass)
          Gets the dereferenced value corresponding to the given key, forcing its instantiation in case of missing entry.
 void setUpdateable(boolean value)
           
protected  void setUpdated(boolean value)
           
protected  void setVirtual(boolean value)
           
 int size()
           
 PdfDictionary swap(PdfObject other)
          Swaps contents between this object and the other one.
 String toString()
           
 Collection<PdfDirectObject> values()
           
 void writeTo(IOutputStream stream, File context)
          Serializes this object to the specified stream.
 
Methods inherited from class org.pdfclown.objects.PdfObject
clone, clone, getContainer, getDataContainer, getFile, getIndirectObject, getReference, resolve, resolve, unresolve, unresolve, update
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PdfDictionary

public PdfDictionary()

PdfDictionary

public PdfDictionary(int capacity)

PdfDictionary

public PdfDictionary(PdfName[] keys,
                     PdfDirectObject[] values)

PdfDictionary

public PdfDictionary(Map<PdfName,PdfDirectObject> entries)
Method Detail

accept

public PdfObject accept(IVisitor visitor,
                        Object data)
Description copied from interface: IVisitable
Accepts a visit.

Specified by:
accept in interface IVisitable
Parameters:
visitor - Visiting object.
data - Supplemental data.
Returns:
Result object.

clone

public PdfDictionary clone(File context)
Description copied from class: PdfObject
Creates a deep copy of this object within the specified file context.

Overrides:
clone in class PdfObject

compareTo

public int compareTo(PdfDirectObject obj)
Specified by:
compareTo in interface Comparable<PdfDirectObject>
Specified by:
compareTo in class PdfDirectObject

get

public <T extends PdfDataObject> PdfDirectObject get(PdfName key,
                                                     Class<T> valueClass)
Gets the value corresponding to the given key, forcing its instantiation as a direct object in case of missing entry.

Parameters:
key - Key whose associated value is to be returned.
valueClass - Class to use for instantiating the value in case of missing entry.
Since:
0.1.2

get

public <T extends PdfDataObject> PdfDirectObject get(PdfName key,
                                                     Class<T> valueClass,
                                                     boolean direct)
Gets the value corresponding to the given key, forcing its instantiation in case of missing entry.

Parameters:
key - Key whose associated value is to be returned.
valueClass - Class to use for instantiating the value in case of missing entry.
direct - Whether the item has to be instantiated directly within its container instead of being referenced through an indirect object.
Since:
0.1.2

getKey

public PdfName getKey(PdfDirectObject value)
Gets the key associated to the specified value.


getParent

public PdfObject getParent()
Description copied from class: PdfObject
Gets the parent of this object.

Specified by:
getParent in class PdfObject
See Also:
PdfObject.getContainer()

isUpdateable

public boolean isUpdateable()
Description copied from class: PdfObject
Gets whether the detection of object state changes is enabled.

Specified by:
isUpdateable in class PdfObject

isUpdated

public boolean isUpdated()
Description copied from class: PdfObject
Gets whether the initial state of this object has been modified.

Specified by:
isUpdated in class PdfObject

resolve

public PdfDataObject resolve(PdfName key)
Gets the dereferenced value corresponding to the given key.

This method takes care to resolve the value returned by get(Object).

Parameters:
key - Key whose associated value is to be returned.
Returns:
null, if the map contains no mapping for this key.
Since:
0.0.8

resolve

public <T extends PdfDataObject> T resolve(PdfName key,
                                           Class<T> valueClass)
Gets the dereferenced value corresponding to the given key, forcing its instantiation in case of missing entry.

This method takes care to resolve the value returned by get(PdfName, Class).

Parameters:
key - Key whose associated value is to be returned.
valueClass - Class to use for instantiating the value in case of missing entry.
Returns:
null, if the map contains no mapping for this key.
Since:
0.1.2

setUpdateable

public void setUpdateable(boolean value)
Specified by:
setUpdateable in class PdfObject
See Also:
PdfObject.isUpdateable()

swap

public PdfDictionary swap(PdfObject other)
Description copied from class: PdfObject
Swaps contents between this object and the other one.

Specified by:
swap in class PdfObject
Parameters:
other - Object whose contents have to be swapped with this one's.
Returns:
This object.

toString

public String toString()
Overrides:
toString in class Object

writeTo

public void writeTo(IOutputStream stream,
                    File context)
Description copied from class: PdfObject
Serializes this object to the specified stream.

Specified by:
writeTo in class PdfObject
Parameters:
stream - Target stream.
context - File context.

clear

public void clear()
Specified by:
clear in interface Map<PdfName,PdfDirectObject>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<PdfName,PdfDirectObject>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<PdfName,PdfDirectObject>

entrySet

public Set<Map.Entry<PdfName,PdfDirectObject>> entrySet()
Specified by:
entrySet in interface Map<PdfName,PdfDirectObject>

equals

public boolean equals(Object object)
Specified by:
equals in interface Map<PdfName,PdfDirectObject>
Overrides:
equals in class Object

get

public PdfDirectObject get(Object key)
Specified by:
get in interface Map<PdfName,PdfDirectObject>

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<PdfName,PdfDirectObject>
Overrides:
hashCode in class Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<PdfName,PdfDirectObject>

keySet

public Set<PdfName> keySet()
Specified by:
keySet in interface Map<PdfName,PdfDirectObject>

put

public PdfDirectObject put(PdfName key,
                           PdfDirectObject value)
Specified by:
put in interface Map<PdfName,PdfDirectObject>

putAll

public void putAll(Map<? extends PdfName,? extends PdfDirectObject> entries)
Specified by:
putAll in interface Map<PdfName,PdfDirectObject>

remove

public PdfDirectObject remove(Object key)
Specified by:
remove in interface Map<PdfName,PdfDirectObject>

size

public int size()
Specified by:
size in interface Map<PdfName,PdfDirectObject>

values

public Collection<PdfDirectObject> values()
Specified by:
values in interface Map<PdfName,PdfDirectObject>

isVirtual

protected boolean isVirtual()
Description copied from class: PdfObject
Gets whether this object acts like a null-object placeholder.

Specified by:
isVirtual in class PdfObject

setUpdated

protected void setUpdated(boolean value)
Specified by:
setUpdated in class PdfObject
See Also:
PdfObject.isUpdated()

setVirtual

protected void setVirtual(boolean value)
Specified by:
setVirtual in class PdfObject
See Also:
PdfObject.isVirtual()

PDF Clown
0.1.2

Project home page

Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.