The SplDoublyLinkedList class

(PHP 5 >= 5.3.0, PHP 7)

简介

The SplDoublyLinkedList class provides the main functionalities of a doubly linked list.

类摘要

SplDoublyLinkedList implements Iterator , ArrayAccess , Countable , Serializable {
/* 常量 */
const integer IT_MODE_LIFO = 2 ;
const integer IT_MODE_FIFO = 0 ;
const integer IT_MODE_DELETE = 1 ;
const integer IT_MODE_KEEP = 0 ;
/* 方法 */
public __construct ( void )
public add ( mixed $index , mixed $newval ) : void
public bottom ( void ) : mixed
public count ( void ) : int
public current ( void ) : mixed
public getIteratorMode ( void ) : int
public isEmpty ( void ) : bool
public key ( void ) : mixed
public next ( void ) : 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 ( void ) : mixed
public prev ( void ) : void
public push ( mixed $value ) : void
public rewind ( void ) : void
public serialize ( void ) : string
public setIteratorMode ( int $mode ) : void
public shift ( void ) : mixed
public top ( void ) : mixed
public unserialize ( string $serialized ) : void
public unshift ( mixed $value ) : void
public valid ( void ) : bool
}

预定义常量

Iteration Direction

SplDoublyLinkedList::IT_MODE_LIFO

The list will be iterated in a last in, first out order, like a stack.

SplDoublyLinkedList::IT_MODE_FIFO

The list will be iterated in a first in, first out order, like a queue.

Iteration Behavior

SplDoublyLinkedList::IT_MODE_DELETE

Iteration will remove the iterated elements.

SplDoublyLinkedList::IT_MODE_KEEP

Iteration will not remove the iterated elements.

Table of Contents

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top