Module::Generic::Iterator::Element - An Array Iterator Element Object Class
my $i = Module::Generic::Iterator->new( [qw( Joe John Mary )] ); # or also: my $a = Module::Generic::Array->new( [qw( Joe John Mary )] ); my $i = $a->iterator; while( $i->has_next ) { my $elem = $i->next; my $value = $elem->value; # Get the next element relative to our element printf( "Next value is: %s at offset %d\n", $elem->next, $elem->next->pos ); }
v0.1.0
This is an object class for Module::Generic::Iterator::Element objects as returned by various methods of Module::Generic::Iterator.
Provided with an array value (whatever that may be) and an optional hash reference of parameters, and this will create a new iterator and return it.
Typical parameters are:
This is the Module::Generic::Iterator object and it is required.
Returns true if there is another item after the current one.
Returns true if there is another item before the current one.
Returns the next Module::Generic::Iterator::Element object relative to this object or undef if there are no more element.
Sets or gets a Module::Generic::Iterator object as the parent object for this array element.
Returns the position of the object inside the parent array. This is read-only and returns an integer.
Returns the previous Module::Generic::Iterator::Element object relative to this object or undef if there are no more previous element.
Return the value of the Module::Generic::Iterator::Element object, whatever that may be.
Module::Generic::Iterator::Element, Module::Generic::Array
Jacques Deguest <jack@deguest.jp>
Copyright (c) 2000-2020 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
To install Module::Generic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Generic
CPAN shell
perl -MCPAN -e shell install Module::Generic
For more information on module installation, please visit the detailed CPAN module installation guide.