Class::Iter - Iterator superclass for Class::Visitor
use Class::Visitor; visitor_class 'CLASS', 'SUPER', { TEMPLATE }; visitor_class 'CLASS', 'SUPER', [ TEMPLATE ]; $obj = CLASS->new (); $iter = $obj->iter; $iter = $obj->iter ($parent, $array, $index); $iter->parent; $iter->is_iter; $iter->root; $iter->rootpath; $iter->next; $iter->at_end; $iter->delegate; $iter->is_same ($obj);
Class::Iter defines the majority of iterator methods for iterator classes created by Class::Visitor.
Class::Iter
Class::Visitor
parent returns the parent of this iterator, or undef if this is the root object.
parent
undef
is_iter returns true indicating that this object is an iterator (all other is_TYPE queries would be passed on to the delegate).
is_iter
is_TYPE
root returns the root parent of this iterator.
root
rootpath returns an array of all iterators between and including the root and this iterator.
rootpath
next returns the iterator of the object after this object in the parent's element. If there is no next object, next returns $self.
next
$self
at_end returns true if this is the last object in the parent's element, i.e. it returns true if next would return $self.
at_end
delegate returns the object that this iterator stands-in for.
delegate
is_same returns true if $obj is the delegate or if $obj is an iterator pointing to the same object.
is_same
$obj
Ken MacLeod, ken@bitsko.slc.ut.us
perl(1), Class::Visitor(3).
To install Class::Visitor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Visitor
CPAN shell
perl -MCPAN -e shell install Class::Visitor
For more information on module installation, please visit the detailed CPAN module installation guide.