HTML::Widgets::NavMenu::Tree::Iterator::Stack - a simple stack class.


HTML-Widgets-NavMenu documentation  | view source Contained in the HTML-Widgets-NavMenu distribution.

Index


NAME

Top

HTML::Widgets::NavMenu::Tree::Iterator::Stack - a simple stack class.

SYNOPSIS

Top

For internal use only.

METHODS =cut

Top

sub push { my $self = shift; my $item = shift;

    push @{$self->_items()}, $item;

    return 0;
}

$s->push($myitem)

Pushes an item.

$s->len($myitem)

Returns the number of elements.

$s->top()

Returns the highest item.

my $item = $s->item($index)

Returns the item of index $index.

my $item = $s->pop()

Pops the item and returns it.

my $bool = $s->is_empty()

Returns true if the stack is empty.

$s->reset();

Empties the stack

COPYRIGHT & LICENSE

Top


HTML-Widgets-NavMenu documentation  | view source Contained in the HTML-Widgets-NavMenu distribution.