Initial docs for SplDoublyLinkedList, SplQueue and SplStack, with all files

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@259586 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Etienne Kneuss 2008-05-12 00:29:35 +00:00
parent 89cb5a9d02
commit 0264840fd5
24 changed files with 1564 additions and 0 deletions

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.construct" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::__construct</refname>
<refpurpose>Constructs a new doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<constructorsynopsis>
<methodname>SplDoublyLinkedList::__construct</methodname>
<void />
</constructorsynopsis>
<para>
This constructs a new empty doubly linked list.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>SplDoublyLinkedList::__construct</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$dll = new SplDoublyLinkedList();
$dll->push(2);
$dll->push(3);
$dll->unshift(5);
var_dump($dll);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
object(SplDoublyLinkedList)#1 (2) {
["flags":"SplDoublyLinkedList":private]=>
int(0)
["dllist":"SplDoublyLinkedList":private]=>
array(3) {
[0]=>
int(5)
[1]=>
int(2)
[2]=>
int(3)
}
}
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.count" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::count</refname>
<refpurpose>Counts the number of elements in the doubly linked list.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>SplDoublyLinkedList::count</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the number of elements in the doubly linked list.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,52 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.current" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::current</refname>
<refpurpose>Return current array entry</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplDoublyLinkedList::current</methodname>
<void/>
</methodsynopsis>
<para>
Get the current doubly linked list node.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The current node value.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.getiteratormode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::getIteratorMode</refname>
<refpurpose>Returns the mode of iteration</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>SplDoublyLinkedList::getIteratorMode</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the different modes and flags that affect the iteration.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.isempty" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::isEmpty</refname>
<refpurpose>Checks whether the doubly linked list is empty.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>SplDoublyLinkedList::isEmpty</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns whether the doubly linked list is empty.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,53 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.key" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::key</refname>
<refpurpose>Return current node index</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplDoublyLinkedList::key</methodname>
<void/>
</methodsynopsis>
<para>
This function returns the current node index
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The current node index.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,53 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.next" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::next</refname>
<refpurpose>Move to next entry</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplDoublyLinkedList::next</methodname>
<void/>
</methodsynopsis>
<para>
Move the iterator to the next node.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.offsetexists" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::offsetExists</refname>
<refpurpose>Returns whether the requested $index exists</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>SplDoublyLinkedList::offsetExists</methodname>
<methodparam><type>mixed</type><parameter>index</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
The index being checked.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if the requested <parameter>index</parameter> exists, otherwise &false;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.offsetget" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::offsetGet</refname>
<refpurpose>Returns the value at the specified $index</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplDoublyLinkedList::offsetGet</methodname>
<methodparam><type>mixed</type><parameter>index</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
The index with the value.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value at the specified <parameter>index</parameter>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.offsetset" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::offsetSet</refname>
<refpurpose>Sets the value at the specified $index to $newval</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplDoublyLinkedList::offsetSet</methodname>
<methodparam><type>mixed</type><parameter>index</parameter></methodparam>
<methodparam><type>mixed</type><parameter>newval</parameter></methodparam>
</methodsynopsis>
<para>
Sets the value at the specified <parameter>index</parameter> to <parameter>newval</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
The index being set.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>newval</parameter></term>
<listitem>
<para>
The new value for the <parameter>index</parameter>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,65 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.offsetunset" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::offsetUnset</refname>
<refpurpose>Unsets the value at the specified $index</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplDoublyLinkedList::offsetUnset</methodname>
<methodparam><type>mixed</type><parameter>index</parameter></methodparam>
</methodsynopsis>
<para>
Unsets the value at the specified index.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
The index being unset.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.pop" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::pop</refname>
<refpurpose>Pops a node from then end of the doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplDoublyLinkedList::pop</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value of the popped node.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,64 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.push" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::push</refname>
<refpurpose>Pushes an element at the end of the doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplDoublyLinkedList::push</methodname>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Pushes <parameter>value</parameter> at the end of the doubly linked list.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The value to push.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,53 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.rewind" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::rewind</refname>
<refpurpose>Rewind iterator back to the start</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplDoublyLinkedList::rewind</methodname>
<void/>
</methodsynopsis>
<para>
This rewinds the iterator to the beginning.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,81 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.setiteratormode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::setIteratorMode</refname>
<refpurpose>Sets the mode of iteration</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplDoublyLinkedList::setIteratorMode</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
There are two orthogonal sets of modes that can be set:
</para>
<itemizedlist>
<listitem>
<simpara>The direction of the iteration (either one or the other):</simpara>
<itemizedlist>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_LIFO (Stack style)</simpara></listitem>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_FIFO (Queue style)</simpara></listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>The behavior of the iterator (either one or the other):</simpara>
<itemizedlist>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_DELETE (Elements are deleted by the iterator)</simpara></listitem>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_KEEP (Elements are traversed by the iterator)</simpara></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>
The default mode is 0 : SplDoublyLnkedList::IT_MODE_FIFO | SplDoublyLnkedList::IT_MODE_KEEP
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.shift" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::shift</refname>
<refpurpose>Shifts a node from the beginning of the doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplDoublyLinkedList::shift</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value of the shifted node.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,64 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.unshift" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::unshift</refname>
<refpurpose>Prepends the doubly linked list with an element</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplDoublyLinkedList::unshift</methodname>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Prepends <parameter>value</parameter> at the beginning of the doubly linked list.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The value to unshift.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,53 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.valid" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::valid</refname>
<refpurpose>Check whether the doubly linked list contains more entries</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>SplDoublyLinkedList::valid</methodname>
<void/>
</methodsynopsis>
<para>
Checks if the doubly linked list contains any more nodes.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true; if the doubly linked list contains any more nodes, &false; otherwise.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,112 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splqueue.construct" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplQueue::__construct</refname>
<refpurpose>Constructs a new queue implemented using a doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<constructorsynopsis>
<methodname>SplQueue::__construct</methodname>
<void/>
</constructorsynopsis>
<para>
This constructs a new empty queue.
<note>
<para>
This method automatically sets the iterator mode to
SplDoublyLinkedList::IT_MODE_FIFO.
</para>
</note>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>SplQueue::__construct</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$q = new SplQueue();
$q[] = 1;
$q[] = 2;
$q[] = 3;
foreach ($q as $elem) {
echo $elem."\n";
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
1
2
3
]]>
</screen>
</example>
<example>
<title>Efficiently handling tasks with <classname>SplQueue</classname></title>
<programlisting role="php">
<![CDATA[
<?php
$q = new SplQueue();
$q->setIteratorMode(SplQueue::IT_MODE_DELETE);
// ... enqueue some tasks on the queue ...
// process them
foreach ($q as $task) {
// ... process $task ...
// add new tasks on the queue
$q[] = $newTask;
// ...
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,57 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splqueue.dequeue" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplQueue::dequeue</refname>
<refpurpose>Dequeues a node from the queue</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplQueue::dequeue</methodname>
<void />
</methodsynopsis>
<para>
Dequeues <parameter>value</parameter> from the top of of the queue.
</para>
<note>
<para>
<methodname>SplQueue::dequeue</methodname> is an alias of <methodname>SplDoublyLinkedList::shift</methodname>.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value of the dequeued node.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,68 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splqueue.enqueue" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplQueue::enqueue</refname>
<refpurpose>Adds an element to the queue.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplQueue::enqueue</methodname>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Enqueues <parameter>value</parameter> at the end of the queue.
</para>
<note>
<para>
<methodname>SplQueue::enqueue</methodname> is an alias of <methodname>SplDoublyLinkedList::push</methodname>.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The value to enqueue.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,81 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splqueue.setiteratormode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplQueue::setIteratorMode</refname>
<refpurpose>Sets the mode of iteration</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplQueue::setIteratorMode</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
There is only one iteration parameter you can modify.
</para>
<itemizedlist>
<listitem>
<simpara>The behavior of the iterator (either one or the other):</simpara>
<itemizedlist>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_DELETE (Elements are deleted by the iterator)</simpara></listitem>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_KEEP (Elements are traversed by the iterator)</simpara></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>
The default mode is 0x0 : SplDoublyLnkedList::IT_MODE_FIFO | SplDoublyLnkedList::IT_MODE_KEEP
</para>
<warning>
<para>
The direction of iteration can no longer be changer for SplQueues.
Trying to do so will result in a RuntimeException being thrown.
</para>
</warning>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,90 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splstack.construct" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplStack::__construct</refname>
<refpurpose>Constructs a new stack implemented using a doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<constructorsynopsis>
<methodname>SplStack::__construct</methodname>
<void/>
</constructorsynopsis>
<para>
This constructs a new empty stack.
<note>
<para>
This method automatically sets the iterator mode to
SplDoublyLinkedList::IT_MODE_LIFO.
</para>
</note>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>SplStack::__construct</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$q = new SplStack();
$q[] = 1;
$q[] = 2;
$q[] = 3;
foreach ($q as $elem) {
echo $elem."\n";
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
3
2
1
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,81 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splstack.setiteratormode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplStack::setIteratorMode</refname>
<refpurpose>Sets the mode of iteration</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplStack::setIteratorMode</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
There is only one iteration parameter you can modify.
</para>
<itemizedlist>
<listitem>
<simpara>The behavior of the iterator (either one or the other):</simpara>
<itemizedlist>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_DELETE (Elements are deleted by the iterator)</simpara></listitem>
<listitem><simpara>SplDoublyLnkedList::IT_MODE_KEEP (Elements are traversed by the iterator)</simpara></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>
The default mode is 0x2 : SplDoublyLnkedList::IT_MODE_LIFO | SplDoublyLnkedList::IT_MODE_KEEP
</para>
<warning>
<para>
The direction of iteration can no longer be changer for SplStacks.
Trying to do so will result in a RuntimeException being thrown.
</para>
</warning>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->