org.foray.pdf.object
Class PDFNameTree<T extends PDFObject>
java.lang.Object
org.foray.pdf.object.PDFObject
org.foray.pdf.object.PDFNameTree<T>
- Type Parameters:
T
- The type of value mapped in this name tree.
public class PDFNameTree<T extends PDFObject>
- extends PDFObject
A PDF Name Tree. The Name Tree is described in PDF Reference, Third Edition,
Section 3.8.4.
Method Summary |
void |
add(String key,
T value)
Add a mapping to this name tree. |
T |
get(String key)
Returns a mapped item from its key. |
String |
toPDF()
Represent the object as PDF. |
Methods inherited from class org.foray.pdf.object.PDFObject |
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, output, pdfID, pdfReference, setNumber, stringToByteArray |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PDFNameTree
public PDFNameTree(PDFDocument doc)
- Constructor.
- Parameters:
doc
- The parent PDF document.
toPDF
public String toPDF()
- Represent the object as PDF.
- Returns:
- The PDF string
add
public void add(String key,
T value)
- Add a mapping to this name tree.
- Parameters:
key
- The key to be added.value
- The value to be added.
get
public T get(String key)
- Returns a mapped item from its key.
- Parameters:
key
- The key.
- Returns:
- The mapped item, or null if the key does not exist in this tree.
Copyright © 2017. All rights reserved.