• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/CPANInternal-140/Tree-Simple-VisitorFactory-0.10/lib/Tree/Simple/Visitor/

Lines Matching +refs:Tree +refs:see

2 package Tree::Simple::Visitor::Sort;
11 use base qw(Tree::Simple::Visitor);
43 (blessed($tree) && $tree->isa("Tree::Simple"))
44 || die "Insufficient Arguments : You must supply a valid Tree::Simple object";
93 Tree::Simple::Visitor::Sort - A Visitor for sorting a Tree::Simple object heirarchy
97 use Tree::Simple::Visitor::Sort;
100 my $visitor = Tree::Simple::Visitor::Sort->new();
123 This implements a recursive multi-level sort of a Tree::Simple heirarchy. I think this deserves some more explaination, and the best way to do that is visually.
176 As you can see, no node is moved up or down from it's current depth, but sorted with it's siblings. Flexible customized sorting is possible within this framework, however, this cannot be used for tree-balancing or anything as complex as that.
192 This method accepts a CODE reference as it's C<$filter_function> argument and throws an exception if it is not a code reference. This code reference is used to filter the tree nodes as they are sorted. This can be used to gather specific information from a more complex tree node. The filter function should accept a single argument, which is the current Tree::Simple object.
196 This method accepts a CODE reference as it's C<$sort_function> argument and throws an exception if it is not a code reference. The C<$sort_function> is used by perl's builtin C<sort> routine to sort each level of the tree. The C<$sort_function> is passed two Tree::Simple objects, and must return 1 (greater than), 0 (equal to) or -1 (less than). The sort function will override and bypass any node filters which have been applied (see C<setNodeFilter> method above), they cannot be used together.
198 Several pre-built sort functions are provided. All of these functions assume that calling C<getNodeValue> on the Tree::Simple object will return a suitable sortable value.
224 If you need to implement one of these sorting routines, but need special handling of your Tree::Simple objects (such as would be done with a node filter), I suggest you read the source code and copy and modify your own sort routine. If it is requested enough I will provide this feature in future versions, but for now I am not sure there is a large need.
228 This is the method that is used by Tree::Simple's C<accept> method. It can also be used on its own, it requires the C<$tree> argument to be a Tree::Simple object (or derived from a Tree::Simple object), and will throw and exception otherwise.
240 See the B<CODE COVERAGE> section in L<Tree::Simple::VisitorFactory> for more inforamtion.
244 These Visitor classes are all subclasses of B<Tree::Simple::Visitor>, which can be found in the B<Tree::Simple> module, you should refer to that module for more information.