This file is indexed.

/usr/share/perl5/HTML/Widgets/NavMenu/Tree/Iterator/Stack.pm is in libhtml-widgets-navmenu-perl 1.0703-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package HTML::Widgets::NavMenu::Tree::Iterator::Stack;

use strict;
use warnings;

use base qw(HTML::Widgets::NavMenu::Object);

__PACKAGE__->mk_acc_ref([qw(_items)]);

sub _init
{
    my $self = shift;

    $self->reset();

    return 0;
}

=head1 NAME

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

=head1 SYNOPSIS

For internal use only.

=head1 METHODS
=cut

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

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

    return 0;
}

=head2 $s->push($myitem)

Pushes an item.

=cut

sub len
{
    my $self = shift;

    return scalar(@{$self->_items()});
}

=head2 $s->len($myitem)

Returns the number of elements.

=cut

sub top
{
    my $self = shift;
    return $self->_items->[-1];
}

=head2 $s->top()

Returns the highest item.

=cut


sub item
{
    my $self = shift;
    my $index = shift;
    return $self->_items->[$index];
}

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

Returns the item of index C<$index>.

=cut

sub pop
{
    my $self = shift;
    return pop(@{$self->_items()});
}

=head2 my $item = $s->pop()

Pops the item and returns it.

=cut

sub is_empty
{
    my $self = shift;
    return ($self->len() == 0);
}

=head2 my $bool = $s->is_empty()

Returns true if the stack is empty.

=cut

sub reset
{
    my $self = shift;

    $self->_items([]);

    return 0;
}

=head2 $s->reset();

Empties the stack

=head1 COPYRIGHT & LICENSE

Copyright 2006 Shlomi Fish, all rights reserved.

This program is released under the following license: MIT X11.

=cut

1;