1Tree::Simple::Visitor::UVsaerriaCbolnetDreipbtuThtrCeeldeo:nP:eeS(ri3lm)pDloec:u:mVeinstiattoiro:n:VariableDepthClone(3)
2
3
4
6 Tree::Simple::Visitor::VariableDepthClone - A Visitor for cloning parts
7 of Tree::Simple hierarchy
8
10 use Tree::Simple::Visitor::VariableDepthClone;
11
12 # create an visitor
13 my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
14
15 $visitor->setCloneDepth(3);
16
17 # pass our visitor to the tree
18 $tree->accept($visitor);
19
20 my $partial_tree = $visitor->getClone();
21
23 This visitor will clone
24
26 new There are no arguments to the constructor the object will be in its
27 default state. You can use the "setNodeFilter" method to customize
28 its behavior.
29
30 includeTrunk ($boolean)
31 Based upon the value of $boolean, this will tell the visitor to
32 include the trunk of the tree in the traversal as well. This
33 basically means it will clone the root node as well.
34
35 setCloneDepth ($number)
36 setNodeFilter ($filter_function)
37 This method accepts a CODE reference as its $filter_function
38 argument and throws an exception if it is not a code reference.
39 This code reference is used to filter the tree nodes as they are
40 cloned.
41
42 visit ($tree)
43 This is the method that is used by the Tree::Simple "accept"
44 method. It can also be used on its own, it requires the $tree
45 argument to be a Tree::Simple object (or derived from a
46 Tree::Simple object), and will throw and exception otherwise.
47
48 getClone
49 This method returns the cloned partial tree.
50
52 <https://github.com/ronsavage/Tree-Simple-VisitorFactory>
53
55 Bugs should be reported via the CPAN bug tracker at
56
57 <https://github.com/ronsavage/Tree-Simple-VisitorFactory/issues>
58
60 See the CODE COVERAGE section in Tree::Simple::VisitorFactory for more
61 information.
62
64 These Visitor classes are all subclasses of Tree::Simple::Visitor,
65 which can be found in the Tree::Simple module, you should refer to that
66 module for more information.
67
69 stevan little, <stevan@iinteractive.com>
70
72 Copyright 2005 by Infinity Interactive, Inc.
73
74 <http://www.iinteractive.com>
75
76 This library is free software; you can redistribute it and/or modify it
77 under the same terms as Perl itself.
78
79
80
81perl v5.36.0 2T0r2e2e-:0:7S-i2m2ple::Visitor::VariableDepthClone(3)