|
|||||||||
| 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.HashMap |
entries
Table of associative pairs of objects. |
static Name |
FORM_TYPE_KEY
|
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 |
static Name |
LENGTH_KEY
|
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.HashMap entries)
Creates a new instance of a Dictionary. |
|
| Method Summary | |
|---|---|
java.util.HashMap |
getEntries()
Gets a copy of the entries that make up the Dictionary. |
float |
getFloat(Name key)
Gets a float specified by the key in the dictionary
entries. |
int |
getInt(Name key)
Gets an int specified by the key in the dictionary
entries. |
Library |
getLibrary()
Gets the PDF Documents Library. |
protected java.lang.Number |
getNumber(Name key)
Gets a Number specified by the key in the dictionary
entries. |
java.lang.Object |
getObject(Name 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
public static final Name LENGTH_KEY
public static final Name FORM_TYPE_KEY
protected Library library
Library object which
acts a central repository for the access of PDF object in the document.
protected java.util.HashMap entries
protected boolean inited
protected boolean isDeleted
protected boolean isNew
| Constructor Detail |
|---|
public Dictionary(Library library,
java.util.HashMap 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.HashMap getEntries()
public java.lang.Object getObject(Name key)
protected java.lang.Number getNumber(Name 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 HashMap.
public int getInt(Name 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 HashMap.
public float getFloat(Name 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 HashMap.
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 | ||||||||