org.icepdf.core.pobjects
Class NameTree
java.lang.Object
org.icepdf.core.pobjects.Dictionary
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
|
Constructor Summary |
NameTree(Library l,
java.util.HashMap h)
Creates a new instance of a NameTree. |
|
Method Summary |
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, getPObjectReference, isDeleted, isNew, setDeleted, setNew, setPObjectReference, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NameTree
public NameTree(Library l,
java.util.HashMap h)
- Creates a new instance of a NameTree.
- Parameters:
l - document library.h - NameTree dictionary entries.
init
public void init()
- Initiate the NameTree.
- Overrides:
init in class Dictionary
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()