mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 14:28:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344250 c90b9560-bf6c-de11-be94-00142212c4b1
118 lines
2.8 KiB
XML
118 lines
2.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="pht.vector.updateAt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>pht\Vector::updateAt</refname>
|
|
<refpurpose>Updates a value in the vector</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>void</type><methodname>pht\Vector::updateAt</methodname>
|
|
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This method updates a value at the specified offset in the vector (in linear
|
|
time). The vector will automatically be resized if it is not large enough.
|
|
</para>
|
|
<para>
|
|
Since the <classname>pht\Vector</classname> class supports array access,
|
|
updating values can also be performed using the array subset notation
|
|
(<literal>[]</literal>).
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The value to be inserted into the vector. This value will be serialised
|
|
(since it may be passed around between threads).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>offset</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The offset at which the value will be updated at. This offset must be
|
|
within the 0..(N-1) range (inclusive), where N is the size of the vector.
|
|
Attempting to update at offsets outside of this range will result in an
|
|
<classname>Error</classname> exception.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
No return value.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Updating a value in a vector</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
use pht\Vector;
|
|
|
|
$vector = new Vector();
|
|
|
|
$vector[] = 1;
|
|
$vector[] = 2;
|
|
|
|
$vector->updateAt(3, 0);
|
|
$vector[1] = 4;
|
|
|
|
var_dump($vector);
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
object(pht\Vector)#1 (2) {
|
|
[0]=>
|
|
int(3)
|
|
[1]=>
|
|
int(4)
|
|
}
|
|
]]>
|
|
</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:"~/.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
|
|
-->
|