Class: HexaPDF::NameTreeNode

Inherits:
Dictionary show all
Includes:
Utils::SortedTreeNode
Defined in:
lib/hexapdf/name_tree_node.rb

Overview

Implementation of PDF name trees.

Name trees are used in a similar fashion as dictionaries, however, the key in a name tree is always a string instead of a symbol. Another difference is that the keys in a name tree are always sorted to allow fast lookup of a specific key.

A name tree consists of one or more NameTreeNodes. If there is only one node, it contains all stored associations in the /Names entry. Otherwise the root node needs to have a /Kids entry that points to one or more intermediate or leaf nodes. An intermediate node contains a /Kids entry whereas a leaf node contains a /Names entry.

Since this is a complex structure that must follow several restrictions, it is not advised to build a name tree manually. Instead, use the provided convenience methods (see HexaPDF::Utils::SortedTreeNode) to add or retrieve entries. They ensure that the name tree stays valid.

See: PDF2.0 s7.9.6

Constant Summary

Constants included from DictionaryFields

DictionaryFields::Boolean, DictionaryFields::PDFByteString, DictionaryFields::PDFDate

Instance Attribute Summary

Attributes inherited from Object

#data, #document, #must_be_indirect

Method Summary

Methods included from Utils::SortedTreeNode

#add_entry, #delete_entry, #each_entry, #find_entry, #must_be_indirect?

Methods inherited from Dictionary

#[], #[]=, define_field, define_type, #delete, #each, each_field, #empty?, field, #key?, #to_hash, type, #type

Methods inherited from Object

#<=>, #==, #cache, #cached?, #clear_cache, deep_copy, #deep_copy, #document?, #eql?, field, #gen, #gen=, #hash, #indirect?, #initialize, #inspect, make_direct, #must_be_indirect?, #null?, #oid, #oid=, #type, #validate, #value, #value=

Constructor Details

This class inherits a constructor from HexaPDF::Object