com.etymon.pjx
Class PdfDictionary

java.lang.Object
  extended by com.etymon.pjx.PdfObject
      extended by com.etymon.pjx.PdfDictionary
All Implemented Interfaces:
java.lang.Cloneable

public class PdfDictionary
extends PdfObject

Represents the PDF dictionary object.


Field Summary
protected  java.util.Map _m
          The contents of the dictionary.
 
Constructor Summary
protected PdfDictionary()
          A protected constructor intended to be called only from wrap(Map).
  PdfDictionary(java.util.Map m)
          Constructs a dictionary object from a map of PdfName keys and PdfObject values.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this instance with another PDF object for equality.
protected  PdfObject filterContents(PdfObjectFilter f)
          Second stage filtering, called by filter(PdfObjectFilter).
 java.util.Map getMap()
          Returns the map of keys and values contained in this dictionary.
 int hashCode()
          Returns a hash code for this object.
protected static PdfDictionary wrap(java.util.Map m)
          A factory for fast construction of this class.
protected  int writePdf(PdfWriter w, boolean spacing)
          Writes this object in PDF format.
 
Methods inherited from class com.etymon.pjx.PdfObject
clone, filter, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_m

protected java.util.Map _m
The contents of the dictionary.

Constructor Detail

PdfDictionary

protected PdfDictionary()
A protected constructor intended to be called only from wrap(Map).


PdfDictionary

public PdfDictionary(java.util.Map m)
Constructs a dictionary object from a map of PdfName keys and PdfObject values.

Parameters:
m - the map containing the keys and values.
Method Detail

filterContents

protected PdfObject filterContents(PdfObjectFilter f)
                            throws PdfFormatException
Description copied from class: PdfObject
Second stage filtering, called by filter(PdfObjectFilter). This is only called if PdfObjectFilter.preFilter(PdfObject) did not return null.

Overrides:
filterContents in class PdfObject
Returns:
the new filtered object.
Throws:
PdfFormatException

equals

public boolean equals(java.lang.Object obj)
Description copied from class: PdfObject
Compares this instance with another PDF object for equality.

Overrides:
equals in class PdfObject
Parameters:
obj - the object to compare this instance with.
Returns:
true if the PDF objects are equal.

getMap

public java.util.Map getMap()
Returns the map of keys and values contained in this dictionary.

Returns:
the map of keys and values. The returned Map object is unmodifiable.

hashCode

public int hashCode()
Description copied from class: PdfObject
Returns a hash code for this object.

Overrides:
hashCode in class PdfObject
Returns:
the hash code.

wrap

protected static PdfDictionary wrap(java.util.Map m)
A factory for fast construction of this class. The constructed object will be a wrapper around the specified Map. The calling method must ensure that the Map is never externally modified, in order to meet the immutability requirement of PdfObject.

Parameters:
m - the Map to be used to back this dictionary.
Returns:
the constructed object.

writePdf

protected int writePdf(PdfWriter w,
                       boolean spacing)
                throws java.io.IOException
Description copied from class: PdfObject
Writes this object in PDF format.

Specified by:
writePdf in class PdfObject
Parameters:
w - the PdfWriter to write to.
spacing - specifies whether to add white-space before the object. A value of true enables the addition of white-space. If the object begins with a PDF delimiter, then this option is ignored and no white-space is written.
Returns:
the number of bytes written by this method.
Throws:
java.io.IOException