com.etymon.pj.object
Class PjDictionary
java.lang.Object
|
+--com.etymon.pj.object.BaseObject
|
+--com.etymon.pj.object.PjObject
|
+--com.etymon.pj.object.PjDictionary
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- PjCatalog, PjEncoding, PjFont, PjFontDescriptor, PjInfo, PjPagesNode, PjResources, PjStreamDictionary
- public class PjDictionary
- extends PjObject
A representation of the PDF dictionary type.
|
Field Summary |
protected java.util.Hashtable |
_h
|
|
Constructor Summary |
PjDictionary()
Creates an empty dictionary. |
PjDictionary(java.util.Hashtable h)
Creates a dictionary as a wrapper around a Hashtable. |
|
Method Summary |
java.lang.Object |
clone()
Returns a deep copy of this object. |
protected java.util.Hashtable |
cloneHt()
|
java.util.Hashtable |
getHashtable()
Returns the Hashtable used to represent this dictionary. |
protected PjObject |
hget(PjName name)
|
protected PjReference |
hgetReference(PjName name)
|
void |
renumber(java.util.Hashtable map)
Renumbers object references within this object. |
long |
writePdf(java.io.OutputStream os)
Writes this dictionary to a stream in PDF format. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_h
protected java.util.Hashtable _h
PjDictionary
public PjDictionary()
- Creates an empty dictionary.
PjDictionary
public PjDictionary(java.util.Hashtable h)
- Creates a dictionary as a wrapper around a Hashtable.
- Parameters:
h - the Hashtable to use for this dictionary.
getHashtable
public java.util.Hashtable getHashtable()
- Returns the Hashtable used to represent this dictionary.
- Returns:
- the Hashtable used to represent this dictionary.
writePdf
public long writePdf(java.io.OutputStream os)
throws java.io.IOException
- Writes this dictionary to a stream in PDF format.
- Overrides:
writePdf in class BaseObject
- Parameters:
os - the stream to write to.- Returns:
- the number of bytes written.
- Throws:
java.io.IOException - if an I/O error occurs.
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Returns a deep copy of this object.
- Overrides:
clone in class BaseObject
- Returns:
- a deep copy of this object.
- Throws:
java.lang.CloneNotSupportedException - if the instance can not be cloned.
cloneHt
protected java.util.Hashtable cloneHt()
throws java.lang.CloneNotSupportedException
renumber
public void renumber(java.util.Hashtable map)
- Renumbers object references within this object. This
method calls itself recursively to comprehensively renumber
all objects contained within this object.
- Overrides:
renumber in class PjObject
- Parameters:
map - the table of object number mappings. Each
object number is looked up by key in the hash table, and
the associated value is assigned as the new object number.
The map hash table should consist of PjNumber keys and
PjReference values.
hget
protected PjObject hget(PjName name)
throws InvalidPdfObjectException
hgetReference
protected PjReference hgetReference(PjName name)
throws InvalidPdfObjectException