SetaPDF_Core_DataStructure_NumberTree Data structure class for Number Trees
File: /SetaPDF v2/Core/DataStructure/NumberTree.php
Leaf nodes per node
The document to which the tree depends to
Is this a new tree or should we update an existing one
The dictionary entry in the dictionary of the root object
A cache for resolved entries
The index is the key while the value is an array of both key and value object.
Find a appropriate leaf node by a key.
If $lowest is set to false the method will search for a leaf node where the key fits between its limit values. If $lowest is set to true the method will return the first leaf node it finds which left limit is bigger than the key.
- $node : SetaPDF_Core_Type_Dictionary
- $key : int
- $exactMatch : bool
- $intermediateNodes : array
Get the entries key name for this implementation.
Get the key class name used by this tree implementation.
Add a keyed value to the tree.
For name trees: Make sure you pass the name in PDFDocEncoding or UTF-16BE including BOM.
- $key : int|string
Depends on the implementation
- $value : SetaPDF_Core_Type_AbstractType
Get the root dictionary entry
Merges another tree into this tree.
As all items have to be unique this method will call a callback function given in $alreadyExistsCallback if an item already exists.
- $tree : SetaPDF_Core_DataStructure_Tree
- $alreadyExistsCallback : null|callback
Will be called if a item already exists.
This method can take control over the renaming of the item. The method will be called as long as it will not throw an exception of SetaPDF_Core_DataStructure_Tree_KeyAlreadyExistsException.
The parameter of the callback function are: The key value and an incremental number of renaming attempts.
An array of renamed items
Returns an array with named keys and name values