Fix typos, add spldoublylinkedlist::top/bottom , initial docs for heaps

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@259718 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Etienne Kneuss 2008-05-13 21:17:36 +00:00
parent 2b8b943783
commit 9e273138cd
24 changed files with 1345 additions and 29 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<book xml:id="book.spl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Standard PHP Library (SPL)</title>
@ -40,6 +40,9 @@
&reference.spl.splstack;
&reference.spl.splqueue;
&reference.spl.splheap;
&reference.spl.splmaxheap;
&reference.spl.splminheap;
</book>

View file

@ -1,37 +1,62 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<appendix xml:id="spl.datastructures" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Datastructures</title>
<para>
SPL provies a set of standard datastructures. They are grouped here by their
underlying implementation which usually defines their general field of
application.
</para>
<section>
<title>Doubly Linked Lists</title>
<sect1>
<para>
A Doubly Linked List (DLL) is a list of nodes linked in both directions to
each others. Iterator's operations, access to both ends, addition or
removal of nodes have a cost of O(1) when the underlying structure is a DLL.
It hence provides a decent implementation for stacks and queues.
SPL provies a set of standard datastructures. They are grouped here by their
underlying implementation which usually defines their general field of
application.
</para>
<itemizedlist>
<listitem>
<simpara><classname>SplDoublyLinkedList</classname></simpara>
<itemizedlist>
<listitem><simpara><classname>SplStack</classname></simpara></listitem>
<listitem><simpara><classname>SplQueue</classname></simpara></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<sect2>
<title>Doubly Linked Lists</title>
</section>
<para>
A Doubly Linked List (DLL) is a list of nodes linked in both directions to
each others. Iterator's operations, access to both ends, addition or
removal of nodes have a cost of O(1) when the underlying structure is a DLL.
It hence provides a decent implementation for stacks and queues.
</para>
<itemizedlist>
<listitem>
<simpara><classname>SplDoublyLinkedList</classname></simpara>
<itemizedlist>
<listitem><simpara><classname>SplStack</classname></simpara></listitem>
<listitem><simpara><classname>SplQueue</classname></simpara></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>Heaps</title>
<para>
Heaps are tree-like structures that follow the heap-property: each node
is greater than or equal to its children, when compared using the
implemented compare method which is global to the heap.
</para>
<itemizedlist>
<listitem>
<simpara><classname>SplHeap</classname></simpara>
<itemizedlist>
<listitem><simpara><classname>SplMaxHeap</classname></simpara></listitem>
<listitem><simpara><classname>SplMinHeap</classname></simpara></listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara><classname>SplPriorityQueue</classname></simpara>
</listitem>
</itemizedlist>
</sect2>
</sect1>
</appendix>

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.bottom" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::bottom</refname>
<refpurpose>Peaks at the node from the beginning of the doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplDoublyLinkedList::bottom</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value of the first 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

@ -1,9 +1,9 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<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>
<refpurpose>Pops a node from the end of the doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">

View file

@ -0,0 +1,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="spldoublylinkedlist.top" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplDoublyLinkedList::top</refname>
<refpurpose>Peaks at the node from the end of the doubly linked list</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplDoublyLinkedList::top</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value of the last 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

@ -1,9 +1,9 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<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>
<refpurpose>Check whether the doubly linked list contains more nodes</refpurpose>
</refnamediv>
<refsect1 role="description">

99
reference/spl/splheap.xml Normal file
View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<reference xml:id="class.splheap" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The SplHeap class</title>
<titleabbrev>SplHeap</titleabbrev>
<partintro>
<!-- {{{ splheap intro -->
<section xml:id="splheap.intro">
&reftitle.intro;
<para>
The SplHeap class provides the main functionalities of an Heap.
</para>
</section>
<!-- }}} -->
<section xml:id="splheap.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>SplHeap</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<modifier>abstract</modifier><classname>SplHeap</classname>
</ooclass>
<oointerface>
<interfacename>Iterator</interfacename>
</oointerface>
<oointerface>
<interfacename>Countable</interfacename>
</oointerface>
</classsynopsisinfo>
<!-- }}} -->
<!-- {{{ If the property is documented below (xml:id=splheap.props) use this
<classsynopsisinfo role="comment">Properties</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="splheap.props.name">name</varname>
</fieldsynopsis>
}}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splheap')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splheap')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
</section>
<!-- {{{ splheap properties
<section xml:id="splheap.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="splheap.props.name">
<term><varname>name</varname></term>
<listitem>
<para>Prop description</para>
</listitem>
</varlistentry>
</variablelist>
</section>
}}} -->
</partintro>
&reference.spl.entities.splheap;
</reference>
<!-- 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,87 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splheap.compare" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::compare</refname>
<refpurpose>Compare elements in order to place them correctly in the heap while sifting up.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>abstract</modifier><type>int</type><methodname>SplHeap::compare</methodname>
<methodparam><type>mixed</type><parameter>value1</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value2</parameter></methodparam>
</methodsynopsis>
<para>
Compare <parameter>value1</parameter> with <parameter>value2</parameter>.
</para>
<warning>
<para>
Throwing exceptions in <methodname>SplHeap::compare</methodname> can
corrupt the Heap and place it in an blocked state. You can unblock is by
calling <methodname>SplHeap::recoverFromCorruption</methodname>.
However, some elements might not be placed correctly and it may hence
break the heap-property.
</para>
</warning>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value1</parameter></term>
<listitem>
<para>
The value of the first node being compared.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value2</parameter></term>
<listitem>
<para>
The value of the second node being compared.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Result of the comparison, positive integer if <parameter>value1</parameter> is greater than <parameter>value2</parameter>, 0 if they are equal, negative integer otherwise.
</para>
<note>
<para>
Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position.
</para>
</note>
</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="splheap.construct" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::__construct</refname>
<refpurpose>Constructs a new empty heap</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<constructorsynopsis>
<methodname>SplHeap::__construct</methodname>
<void />
</constructorsynopsis>
<para>
This constructs a new empty heap.
</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,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splheap.count" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::count</refname>
<refpurpose>Counts the number of elements in the heap.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>SplHeap::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 heap.
</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="splheap.current" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::current</refname>
<refpurpose>Return current node pointed by the iterator</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplHeap::current</methodname>
<void/>
</methodsynopsis>
<para>
Get the current datastructure 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="splheap.extract" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::extract</refname>
<refpurpose>Extracts a node from top of the heap and sift up.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplHeap::extract</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value of the extracted 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="splheap.insert" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::insert</refname>
<refpurpose>Inserts an element in the heap by sifting it up.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplHeap::insert</methodname>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Insert <parameter>value</parameter> in the heap.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The value to insert.
</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="splheap.isempty" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::isEmpty</refname>
<refpurpose>Checks whether the heap is empty.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>SplHeap::isEmpty</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns whether the heap 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="splheap.key" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::key</refname>
<refpurpose>Return current node index</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplHeap::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="splheap.next" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::next</refname>
<refpurpose>Move to the next node</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplHeap::next</methodname>
<void/>
</methodsynopsis>
<para>
Extracts the top node from the heap.
</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,49 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splheap.recoverfromcorruption" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::recoverFromCorruption</refname>
<refpurpose>Recover from the corrupted state and allow further actions on the heap.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplHeap::recoverFromCorruption</methodname>
<void/>
</methodsynopsis>
</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,55 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splheap.rewind" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::rewind</refname>
<refpurpose>Rewind iterator back to the start (no-op)</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplHeap::rewind</methodname>
<void/>
</methodsynopsis>
<para>
This rewinds the iterator to the beginning. This is a no-opp for heaps
as the iterator is virtual and in fact never moves from the top of the
heap.
</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,50 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splheap.top" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::top</refname>
<refpurpose>Peaks at the node from the top of the heap</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>SplHeap::top</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The value of the node on the top.
</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="splheap.valid" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplHeap::valid</refname>
<refpurpose>Check whether the heap contains more nodes</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>SplHeap::valid</methodname>
<void/>
</methodsynopsis>
<para>
Checks if the heap 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 heap 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,107 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<reference xml:id="class.splmaxheap" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The SplMaxHeap class</title>
<titleabbrev>SplMaxHeap</titleabbrev>
<partintro>
<!-- {{{ splmaxheap intro -->
<section xml:id="splmaxheap.intro">
&reftitle.intro;
<para>
The SplMaxHeap class provides the main functionalities of a heap, keeping the maximum on the top.
</para>
</section>
<!-- }}} -->
<section xml:id="splmaxheap.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>SplMaxHeap</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>SplMaxHeap</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>SplHeap</classname>
</ooclass>
<oointerface>
<interfacename>Iterator</interfacename>
</oointerface>
<oointerface>
<interfacename>Countable</interfacename>
</oointerface>
</classsynopsisinfo>
<!-- }}} -->
<!-- {{{ If the property is documented below (xml:id=splmaxheap.props) use this
<classsynopsisinfo role="comment">Properties</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="splmaxheap.props.name">name</varname>
</fieldsynopsis>
}}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splmaxheap')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
<classsynopsisinfo role="comment">Inherited methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splheap')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
</section>
<!-- {{{ splmaxheap properties
<section xml:id="splmaxheap.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="splmaxheap.props.name">
<term><varname>name</varname></term>
<listitem>
<para>Prop description</para>
</listitem>
</varlistentry>
</variablelist>
</section>
}}} -->
</partintro>
&reference.spl.entities.splmaxheap;
</reference>
<!-- 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,78 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splmaxheap.compare" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplMaxHeap::compare</refname>
<refpurpose>Compare elements in order to place them correctly in the heap while sifting up.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplMaxHeap::compare</methodname>
<methodparam><type>mixed</type><parameter>value1</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value2</parameter></methodparam>
</methodsynopsis>
<para>
Compare <parameter>value1</parameter> with <parameter>value2</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value1</parameter></term>
<listitem>
<para>
The value of the first node being compared.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value2</parameter></term>
<listitem>
<para>
The value of the second node being compared.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Result of the comparison, positive integer if <parameter>value1</parameter> is greater than <parameter>value2</parameter>, 0 if they are equal, negative integer otherwise.
</para>
<note>
<para>
Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position.
</para>
</note>
</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,107 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<reference xml:id="class.splminheap" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The SplMinHeap class</title>
<titleabbrev>SplMinHeap</titleabbrev>
<partintro>
<!-- {{{ splminheap intro -->
<section xml:id="splminheap.intro">
&reftitle.intro;
<para>
The SplMinHeap class provides the main functionalities of a heap, keeping the minimum on the top.
</para>
</section>
<!-- }}} -->
<section xml:id="splminheap.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>SplMinHeap</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>SplMinHeap</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>SplHeap</classname>
</ooclass>
<oointerface>
<interfacename>Iterator</interfacename>
</oointerface>
<oointerface>
<interfacename>Countable</interfacename>
</oointerface>
</classsynopsisinfo>
<!-- }}} -->
<!-- {{{ If the property is documented below (xml:id=splminheap.props) use this
<classsynopsisinfo role="comment">Properties</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="splminheap.props.name">name</varname>
</fieldsynopsis>
}}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splminheap')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
<classsynopsisinfo role="comment">Inherited methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.splheap')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
</section>
<!-- {{{ splminheap properties
<section xml:id="splminheap.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="splminheap.props.name">
<term><varname>name</varname></term>
<listitem>
<para>Prop description</para>
</listitem>
</varlistentry>
</variablelist>
</section>
}}} -->
</partintro>
&reference.spl.entities.splminheap;
</reference>
<!-- 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,78 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="splminheap.compare" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>SplMinHeap::compare</refname>
<refpurpose>Compare elements in order to place them correctly in the heap while sifting up.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>SplMinHeap::compare</methodname>
<methodparam><type>mixed</type><parameter>value1</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value2</parameter></methodparam>
</methodsynopsis>
<para>
Compare <parameter>value1</parameter> with <parameter>value2</parameter>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>value1</parameter></term>
<listitem>
<para>
The value of the first node being compared.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value2</parameter></term>
<listitem>
<para>
The value of the second node being compared.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Result of the comparison, positive integer if <parameter>value1</parameter> is lower than <parameter>value2</parameter>, 0 if they are equal, negative integer otherwise.
</para>
<note>
<para>
Having multiple elements with the same value in a Heap is not recommended. They will end up in an arbitrary relative position.
</para>
</note>
</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
-->