La classe SplDoublyLinkedList

(PHP 5 >= 5.3.0, PHP 7)

Introduction

La classe SplDoublyLinkedList fournit l'interface principale pour les listes doublement chaînées.

Synopsis de la classe

SplDoublyLinkedList implements Iterator , ArrayAccess , Countable , Serializable {
/* Constantes */
const int IT_MODE_LIFO = 2 ;
const int IT_MODE_FIFO = 0 ;
const int IT_MODE_DELETE = 1 ;
const int IT_MODE_KEEP = 0 ;
/* Méthodes */
public __construct ( )
public add ( mixed $index , mixed $newval ) : void
public bottom ( ) : mixed
public count ( ) : int
public current ( ) : mixed
public getIteratorMode ( ) : int
public isEmpty ( ) : bool
public key ( ) : mixed
public next ( ) : void
public offsetExists ( mixed $index ) : bool
public offsetGet ( mixed $index ) : mixed
public offsetSet ( mixed $index , mixed $newval ) : void
public offsetUnset ( mixed $index ) : void
public pop ( ) : mixed
public prev ( ) : void
public push ( mixed $value ) : void
public rewind ( ) : void
public serialize ( ) : string
public setIteratorMode ( int $mode ) : void
public shift ( ) : mixed
public top ( ) : mixed
public unserialize ( string $serialized ) : void
public unshift ( mixed $value ) : void
public valid ( ) : bool
}

Constantes pré-définies

Direction d'Itération

SplDoublyLinkedList::IT_MODE_LIFO

La liste sera itérée dans un ordre dernier entré, premier sorti, comme une pile.

SplDoublyLinkedList::IT_MODE_FIFO

La liste sera itérée dans un ordre premier entré, premier sorti, comme une file.

Comportement d'Itération

SplDoublyLinkedList::IT_MODE_DELETE

L'itération supprimera les éléments itérés.

SplDoublyLinkedList::IT_MODE_KEEP

L'itération ne supprimera pas les éléments itérés.

Sommaire