NAME
TPath::Index - general purpose path languages for trees
VERSION
version 0.012
SYNOPSIS
my $f = MyForester->new; # hypothetical forester for my sort of tree
my $root = next_tree(); # generate my sort of tree
my $index = $f->index($root); # construct reusable index for $root
DESCRIPTION
A cache of information about a particular tree. Reuse indices to save effort.
ATTRIBUTES
indexed
The map from ids to nodes.
root
The root of the indexed tree.
METHODS
is_root
Expects a node. Returns whether this node is the root of the tree indexed by this index.
index
Cause this index to walk its tree and perform all necessary indexation.
parent
Expects a node and returns the parent of this node.
pc_index
Record the link from child to parent. If this index is unnecessary for a particular variety of tree -- nodes know their parents -- then you should override this method to be a no-op. It assumes all nodes are references and will throw an error if this is not the case.
id
Returns the unique identifier, if any, that identifies this node. This method delegates to the forester's id
method.
The TPath::Forester that generated this index.
AUTHOR
David F. Houghton <dfhoughton@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by David F. Houghton.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 169:
Unknown directive: =attribute