|
SPL-StandardPHPLibrary
|


Public Member Functions | |
| bottom () | |
| count () | |
| current () | |
| getIteratorMode () | |
| isEmpty () | |
| key () | |
| next () | |
| offsetExists ($offset) | |
| offsetGet ($offset) | |
| offsetSet ($offset, $value) | |
| offsetUnset ($offset) | |
| pop () | |
| push ($data) | |
| rewind () | |
| setIteratorMode ($mode) | |
| shift () | |
| top () | |
| unshift ($data) | |
| valid () | |
Public Attributes | |
| const | IT_MODE_DELETE = 0x00000001 |
| const | IT_MODE_FIFO = 0x00000000 |
| const | IT_MODE_KEEP = 0x00000000 |
| const | IT_MODE_LIFO = 0x00000002 |
Protected Attributes | |
| $_it_mode = parent::IT_MODE_LIFO | |
| $_it_pos = 0 | |
| $_llist = array() | |
Implementation of a stack through a DoublyLinkedList.
As SplStack extends SplDoublyLinkedList, shift() and unshift() are still available even though they don't make much sense for a stack.
The SplStack class provides the main functionalities of a stack implemented using a doubly linked list (DLL).
Definition at line 21 of file splstack.inc.
|
inherited |
Definition at line 97 of file spldoublylinkedlist.inc.
|
inherited |
Implements Countable.
Definition at line 104 of file spldoublylinkedlist.inc.
Referenced by SplDoublyLinkedList\isEmpty(), SplDoublyLinkedList\offsetGet(), SplDoublyLinkedList\offsetSet(), SplDoublyLinkedList\offsetUnset(), SplDoublyLinkedList\pop(), SplDoublyLinkedList\rewind(), and SplDoublyLinkedList\shift().
|
inherited |
Implements Iterator.
Definition at line 170 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\$_it_pos.
|
inherited |
Definition at line 138 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\$_it_mode.
|
inherited |
Definition at line 111 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\count().

|
inherited |
Implements Iterator.
Definition at line 163 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\$_it_pos.
|
inherited |
Forward to next element.
Implements Iterator.
Definition at line 177 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\pop(), and SplDoublyLinkedList\shift().

|
inherited |
| $offset | The offset |
| OutOfRangeException | If the offset is either invalid or out of range. |
Implements ArrayAccess.
Definition at line 199 of file spldoublylinkedlist.inc.
|
inherited |
| $offset | The offset |
| OutOfRangeException | If the offset is either invalid or out of range. |
Implements ArrayAccess.
Definition at line 214 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\count().

|
inherited |
Defines the data at a certain offset in the DLL.
| $offset | The offset |
| $value | New value |
| OutOfRangeException | If the offset is either invalid or out of range. |
Implements ArrayAccess.
Definition at line 236 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\count(), and SplDoublyLinkedList\push().

|
inherited |
Unsets the element at a certain offset in the DLL.
| $offset | The offset |
| OutOfRangeException | If the offset is either invalid or out of range. |
Implements ArrayAccess.
Definition at line 261 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\count().

|
inherited |
| RuntimeException | If the datastructure is empty. |
Definition at line 51 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\count().
Referenced by SplDoublyLinkedList\next().

|
inherited |
Pushes an element to the end of the DLL.
| $data | variable to add to the DLL. |
Definition at line 73 of file spldoublylinkedlist.inc.
Referenced by SplDoublyLinkedList\offsetSet().
|
inherited |
Rewind to top iterator as set in constructor.
Implements Iterator.
Definition at line 145 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\count().

| SplStack::setIteratorMode | ( | $mode | ) |
Changes the iteration mode.
There are two orthogonal sets of modes that can be set:
The default mode is 0 : SplDoublyLnkedList::IT_MODE_LIFO | SplDoublyLnkedList::IT_MODE_KEEP
| $mode | New mode of iteration |
| RuntimeException | If the new mode affects the iteration's direction. |
Definition at line 38 of file splstack.inc.
|
inherited |
| RuntimeException | If the datastructure is empty. |
Definition at line 62 of file spldoublylinkedlist.inc.
References SplDoublyLinkedList\count().
Referenced by SplDoublyLinkedList\next().

|
inherited |
Definition at line 90 of file spldoublylinkedlist.inc.
|
inherited |
Adds an element to the beginning of the DLL.
| $data | variable to add to the DLL. |
Definition at line 82 of file spldoublylinkedlist.inc.
|
inherited |
Implements Iterator.
Definition at line 156 of file spldoublylinkedlist.inc.
|
protected |
Definition at line 23 of file splstack.inc.
|
protectedinherited |
Definition at line 26 of file spldoublylinkedlist.inc.
Referenced by SplDoublyLinkedList\current(), and SplDoublyLinkedList\key().
|
protectedinherited |
Definition at line 24 of file spldoublylinkedlist.inc.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
1.8.5