|
NAMETree::Simple::Visitor::GetAllDescendents - A Visitor for fetching all the descendents of a Tree::Simple object SYNOPSIS use Tree::Simple::Visitor::GetAllDescendents;
# create an instance of our visitor
my $visitor = Tree::Simple::Visitor::GetAllDescendents->new();
# pass the visitor to a Tree::Simple object
$tree->accept($visitor);
# you can also get the descendents
# back as an array of node values
my @descendents = $visitor->getDescendents();
# for more complex node objects, you can specify
# a node filter which will be used to extract the
# information desired from each node
$visitor->setNodeFilter(sub {
my ($t) = @_;
return $t->getNodeValue()->description();
});
DESCRIPTIONGiven a Tree::Simple instance this Visitor will return all the descendents recursively on down the hierarchy. METHODS
Repository<https://github.com/ronsavage/Tree-Simple-VisitorFactory> SUPPORTBugs should be reported via the CPAN bug tracker at <https://github.com/ronsavage/Tree-Simple-VisitorFactory/issues> CODE COVERAGESee the CODE COVERAGE section in Tree::Simple::VisitorFactory for more information. SEE ALSOThese Visitor classes are all subclasses of Tree::Simple::Visitor, which can be found in the Tree::Simple module, you should refer to that module for more information. AUTHORstevan little, <stevan@iinteractive.com> COPYRIGHT AND LICENSECopyright 2004, 2005 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|