|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.Dictionary
public class Dictionary
This class represents a PDF document's Dictionary object. A Dictionary object is an associative table containing pairs of objects, known as the dictionary's entries. The first element of each entry is the key and the second element is the value. Dictionary objects are the main building blocks of a PDF document. They are commonly used to collect and tie together the attributes of complex objects such as fonts or pages within a document.
Most of the Objects found in the package org.icepdf.core.pobject.* extend this class. Dictionary objects by convention have a "Type" entry which identifies the type of object the dictionary describes. Classes that extend Dictionary add functionality based on the specified Dictionary type.
| Field Summary | |
|---|---|
protected java.util.Hashtable<java.lang.Object,java.lang.Object> |
entries
Table of associative pairs of objects. |
protected boolean |
inited
Indicates if Dictionary has been initiated. |
protected boolean |
isDeleted
Flag to indicate this object has been flaged for deletion. |
protected boolean |
isNew
Flags the object as new and not previously saved in the file |
protected Library |
library
Pointer to the documents Library object which
acts a central repository for the access of PDF object in the document. |
static Name |
SUBTYPE_KEY
|
static Name |
TYPE_KEY
|
| Constructor Summary | |
|---|---|
Dictionary(Library library,
java.util.Hashtable entries)
Creates a new instance of a Dictionary. |
|
| Method Summary | |
|---|---|
java.util.Hashtable<java.lang.Object,java.lang.Object> |
getEntries()
Gets a copy of the entries that make up the Dictionary. |
float |
getFloat(java.lang.String key)
Gets a float specified by the key in the dictionary
entries. |
int |
getInt(java.lang.String key)
Gets an int specified by the key in the dictionary
entries. |
Library |
getLibrary()
Gets the PDF Documents Library. |
protected java.lang.Number |
getNumber(java.lang.String key)
Gets a Number specified by the key in the dictionary
entries. |
java.lang.Object |
getObject(Name key)
|
java.lang.Object |
getObject(java.lang.String key)
|
Reference |
getPObjectReference()
Gets the reference used to identify this Dictionary in the PDF document. |
void |
init()
Initiate the Dictionary. |
boolean |
isDeleted()
|
boolean |
isNew()
|
void |
setDeleted(boolean deleted)
|
void |
setNew(boolean aNew)
|
void |
setPObjectReference(Reference reference)
Sets the reference used to identify this Dictionary in the PDF document. |
java.lang.String |
toString()
Returns a summary of the dictionary entries. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Name TYPE_KEY
public static final Name SUBTYPE_KEY
protected Library library
Library object which
acts a central repository for the access of PDF object in the document.
protected java.util.Hashtable<java.lang.Object,java.lang.Object> entries
protected boolean inited
protected boolean isDeleted
protected boolean isNew
| Constructor Detail |
|---|
public Dictionary(Library library,
java.util.Hashtable entries)
library - document library.entries - dictionary entries.| Method Detail |
|---|
public void setPObjectReference(Reference reference)
Sets the reference used to identify this Dictionary in the PDF document. The reference number and generation number of this reference is needed by the encryption algorithm to correctly decrypt this object.
This method should only be used by the PDF Parser. Use of this method outside the context of the PDF Parser may result in unpredictable behavior.
reference - Reference used to identify this Dictionary in the PDF
document.getPObjectReference()public Reference getPObjectReference()
Gets the reference used to identify this Dictionary in the PDF document. The reference number and generation number of this reference is needed by the encryption algorithm to correctly decrypt this object.
setPObjectReference(org.icepdf.core.pobjects.Reference)public void init()
public java.util.Hashtable<java.lang.Object,java.lang.Object> getEntries()
public java.lang.Object getObject(java.lang.String key)
public java.lang.Object getObject(Name key)
protected java.lang.Number getNumber(java.lang.String key)
key in the dictionary
entries. If the value is a reference, the Number object that the
reference points to is returned. If the key cannot be found,
or the resulting object is not a Number, then null is returned.
key - key to find in entries Hashtable.
public int getInt(java.lang.String key)
key in the dictionary
entries. If the value is a reference, the int value that the
reference points to is returned.
key - key to find in entries Hashtable.
public float getFloat(java.lang.String key)
key in the dictionary
entries. If the value is a reference, the float value that the
reference points to is returned.
key - key to find in entries Hashtable.
public Library getLibrary()
public boolean isDeleted()
public void setDeleted(boolean deleted)
public boolean isNew()
public void setNew(boolean aNew)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||