<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.ds-sequence.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'ds-sequence.rotate.php',
    1 => 'Ds\\Sequence::rotate',
    2 => 'Rotates the sequence by a given number of rotations',
  ),
  'up' => 
  array (
    0 => 'class.ds-sequence.php',
    1 => 'Ds\\Sequence',
  ),
  'prev' => 
  array (
    0 => 'ds-sequence.reversed.php',
    1 => 'Ds\\Sequence::reversed',
  ),
  'next' => 
  array (
    0 => 'ds-sequence.set.php',
    1 => 'Ds\\Sequence::set',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ds/ds/sequence/rotate.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ds-sequence.rotate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Ds\Sequence::rotate</h1>
  <p class="verinfo">(PECL ds &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Ds\Sequence::rotate</span> &mdash; <span class="dc-title">Rotates the sequence by a given number of rotations</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-ds-sequence.rotate-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><strong>Ds\Sequence::rotate</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$rotations</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
    Rotates the sequence by a given number of rotations, which is equivalent
    to successively calling <code class="code">$sequence-&gt;push($sequence-&gt;shift())</code> if the number
    of rotations is positive, or <code class="code">$sequence-&gt;unshift($sequence-&gt;pop())</code> if negative.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-ds-sequence.rotate-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">rotations</code></dt>
    <dd>
     <p class="para">
        The number of times the sequence should be rotated.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-ds-sequence.rotate-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
    Nessun valore viene restituito.. The sequence of the current instance will be rotated.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-ds-sequence.rotate-examples">
  <h3 class="title">Esempi</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>Ds\Sequence::rotate()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$sequence </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Ds\Vector</span><span style="color: #007700">([</span><span style="color: #DD0000">"a"</span><span style="color: #007700">, </span><span style="color: #DD0000">"b"</span><span style="color: #007700">, </span><span style="color: #DD0000">"c"</span><span style="color: #007700">, </span><span style="color: #DD0000">"d"</span><span style="color: #007700">]);<br /><br /></span><span style="color: #0000BB">$sequence</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rotate</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">);  </span><span style="color: #FF8000">// "a" is shifted, then pushed.<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$sequence</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$sequence</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rotate</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">);  </span><span style="color: #FF8000">// "b" and "c" are both shifted, the pushed.<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$sequence</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Il precedente esempio visualizzerà
qualcosa simile a:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">(
    [0] =&gt; b
    [1] =&gt; c
    [2] =&gt; d
    [3] =&gt; a
)
Ds\Vector Object
(
    [0] =&gt; d
    [1] =&gt; a
    [2] =&gt; b
    [3] =&gt; c
)</pre>
</div>
   </div>
  </div>
 </div>



</div><?php manual_footer($setup); ?>