org.foray.pdf.object
Class PDFNumberTree<T extends PDFObject>

java.lang.Object
  extended by org.foray.pdf.object.PDFObject
      extended by org.foray.pdf.object.PDFNumberTree<T>
Type Parameters:
T - The type of value mapped in this number tree.

public class PDFNumberTree<T extends PDFObject>
extends PDFObject

A PDF Number Tree. The Number Tree is described in PDF Reference, Third Edition, Section 3.8.5.


Field Summary
 
Fields inherited from class org.foray.pdf.object.PDFObject
EOL, MSG_EOL, XREF_EOL
 
Constructor Summary
PDFNumberTree(PDFDocument doc)
          Constructor.
 
Method Summary
 void add(Integer key, T value)
          Add a mapping to this number tree.
 T get(Integer 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
 

Constructor Detail

PDFNumberTree

public PDFNumberTree(PDFDocument doc)
Constructor.

Parameters:
doc - The parent PDF document.
Method Detail

toPDF

public String toPDF()
Represent the object as PDF.

Returns:
The PDF string.

add

public void add(Integer key,
                T value)
Add a mapping to this number tree.

Parameters:
key - The key to be added.
value - The value to be added.

get

public T get(Integer 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.