The Queue class

(Available since version 1.0)

Introduction

The Queue class provides the main functionalities of a queue implemented using a singly linked list.

It provides the interface as SplQueue and can therefore be used as a drop-in replacement.

Please note that as this is implemented in PHP it will probably be slower in practice than SplQueue (which is implemented in C). It is therefore only recommended for experimental purposes.

Class synopsis

SEIDS::LinkedLists::Singly::Queue extends SEIDS::LinkedLists::Singly::LinkedList {
/* Inherited constants */
const int LinkedList::IT_MODE_KEEP = 0 ;
const int LinkedList::IT_MODE_LIFO = 2 ;
const int LinkedList::IT_MODE_FIFO = 0 ;
/* Inherited properties */
protected SEIDS::LinkedLists::Singly::Item $first ;
protected SEIDS::LinkedLists::Singly::Item $last ;
protected SEIDS::LinkedLists::Singly::Item $current ;
protected int $current_key ;
protected SEIDS::LinkedLists::Singly::Item $worker ;
protected int $worker_key ;
protected int $size ;
protected int $flags ;
/* Methods */
public __construct ( void )
public mixed dequeue ( void )
public bool enqueue ( mixed $value )
/* Inherited methods */
public void LinkedList::__clone ( void )
public void LinkedList::add ( int $index , mixed $newval )
public mixed LinkedList::bottom ( void )
public int LinkedList::count ( void )
public mixed LinkedList::current ( void )
public int LinkedList::getIteratorMode ( void )
public bool LinkedList::isEmpty ( void )
public mixed LinkedList::key ( void )
public void LinkedList::move ( int $offset_from , int $offset_to )
public void LinkedList::next ( void )
public bool LinkedList::offsetExists ( int $index )
public mixed LinkedList::offsetGet ( int $index )
public void LinkedList::offsetSet ( int $index , mixed $newval )
public void LinkedList::offsetUnset ( int $index )
public mixed LinkedList::pop ( void )
public void LinkedList::prev ( void )
public bool LinkedList::push ( mixed $value )
public mixed LinkedList::remove ( int $offset )
public void LinkedList::rewind ( void )
public string LinkedList::serialize ( void )
public int LinkedList::setIteratorMode ( int $mode )
public mixed LinkedList::shift ( void )
public mixed LinkedList::top ( void )
public void LinkedList::unserialize ( string $serialized )
public bool LinkedList::unshift ( mixed $value )
public bool LinkedList::valid ( void )
protected void LinkedList::moveToOffset ( int $offset )
}

Table of Contents

To Top