php-doc-en/reference/spl/splminheap/compare.xml
2018-01-25 15:34:22 +00:00

78 lines
2.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<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>
<modifier>protected</modifier> <type>int</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:"~/.phpdoc/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
-->