org.icepdf.core.pobjects
Class NameTree

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.NameTree

public class NameTree
extends Dictionary

The NameTree class is similar to the Dictionary class in that it associates keys and values, but it does this in a different way. The keys in a NameTree are strings and are ordered and the values of the associated keys may be an object of any type.

The NameTree class is primarily used to store named destinations accessible via the document's Catalog. This class is very simple with only one method which is responsible searching for the given key.

Since:
1.0

Field Summary
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, inited, isDeleted, isNew, library, SUBTYPE_KEY, TYPE_KEY
 
Constructor Summary
NameTree(Library l, java.util.Hashtable h)
          Creates a new instance of a NameTree.
 
Method Summary
 void dispose()
          Dispose the NameTree.
 NameNode getRoot()
           
 void init()
          Initiate the NameTree.
 java.lang.Object searchName(java.lang.String key)
          Searches for the given key in the name tree.
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getObject, getPObjectReference, isDeleted, isNew, setDeleted, setNew, setPObjectReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameTree

public NameTree(Library l,
                java.util.Hashtable h)
Creates a new instance of a NameTree.

Parameters:
l - document library.
h - NameTree dictionary entries.
Method Detail

init

public void init()
Initiate the NameTree.

Overrides:
init in class Dictionary

dispose

public void dispose()
Dispose the NameTree.


searchName

public java.lang.Object searchName(java.lang.String key)
Searches for the given key in the name tree. If the key is found, its associated object is returned. It is important to know the context in which a search is made as the name tree can hold objects of any type.

Parameters:
key - key to look up in name tree.
Returns:
the associated object value if found; null, otherwise.

getRoot

public NameNode getRoot()