The Stack class

(Available since version 1.0)

Introduction

The Stack class provides the main functionalities of a stack implemented using a singly linked list.

Unlike almost all other classes in this collection, this class provides only a very small subset of the methods provided by its SPL equivalent, SplStack. It is, therefore, only a drop-in replacement for SplStack in some circumstances. These limitations are due to LIFO not being supported by the SEIDS::LinkedLists::Singly::LinkedList class on which this class is based (via encapsulation).

Class synopsis

SEIDS::LinkedLists::Singly::Stack implements Countable {
/* Properties */
protected SEIDS::LinkedLists::Singly::LinkedList $ds ;
/* Methods */
public __construct ( void )
public mixed bottom ( void )
public int count ( void )
public bool isEmpty ( void )
public mixed pop ( void )
public bool push ( mixed $value )
public mixed top ( void )
}

Properties

ds

The singly linked list.

Table of Contents

To Top