NAME
Tree::Simple::Manager::Index - A class for quick-access indexing for Tree::Simple hierarchies
SYNOPSIS
use Tree::Simple::Manager::Index;
my $index = Tree::Simple::Manager::Index->new($tree_hierarchy);
my $node_deep_in_the_tree = $index->getTreeByID(100134);
DESCRIPTION
This module will index a Tree::Simple hierarchy so that node's can be quickly accessed without needing to search the entire heirarchy. It currently will index the Tree::Simple nodes by their UID property. Plans for allowing other means of indexing are in the future.
METHODS
- new ($tree)
-
Given a
$tree
it will index all it's nodes by their UID values. - getIndexKeys
-
This will return a list of all the index keys.
- getRootTree
-
This will return the root of the indexed tree.
- getTreeByID ($id)
-
Given an
$id
this will return the tree associated with it. If no tree is associated with it, an exeception will be thrown.
TO DO
BUGS
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.
CODE COVERAGE
I use Devel::Cover to test the code coverage of my tests, see the Tree::Simple::Manager documentation for more details.
AUTHOR
stevan little, <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2004 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.