<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.ds.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'class.ds-queue.php',
    1 => 'Ds\\Queue',
    2 => 'The Queue class',
  ),
  'up' => 
  array (
    0 => 'book.ds.php',
    1 => 'Data Structures',
  ),
  'prev' => 
  array (
    0 => 'ds-stack.toarray.php',
    1 => 'Ds\\Stack::toArray',
  ),
  'next' => 
  array (
    0 => 'ds-queue.allocate.php',
    1 => 'Ds\\Queue::allocate',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ds/ds.queue.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.ds-queue.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.ds-queue" class="reference">

 <h1 class="title">The Queue class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL ds &gt;= 1.0.0)</p>


  <div class="section" id="ds-queue.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    A Queue is a “first in, first out” or “FIFO” collection that only allows
    access to the value at the front of the queue and iterates in that order,
    destructively.
   </p>
  </div>


  <div class="section" id="ds-queue.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <span class="ooclass"><strong class="classname"></strong></span>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">Ds\Queue</strong>
     </span>

     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.ds-collection.php" class="interfacename">Ds\Collection</a></span><span class="oointerface">,  <a href="class.arrayaccess.php" class="interfacename">ArrayAccess</a></span> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.ds-queue.php#ds-queue.constants.min-capacity"><var class="varname">MIN_CAPACITY</var></a></var><span class="initializer"> = 8</span>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="ds-queue.allocate.php" class="methodname">allocate</a></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$capacity</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.capacity.php" class="methodname">capacity</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.clear.php" class="methodname">clear</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.copy.php" class="methodname">copy</a></span>(): <span class="type"><a href="class.ds-queue.php" class="type Ds\Queue">Ds\Queue</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.isempty.php" class="methodname">isEmpty</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.peek.php" class="methodname">peek</a></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.pop.php" class="methodname">pop</a></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.push.php" class="methodname">push</a></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">...$values</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="ds-queue.toarray.php" class="methodname">toArray</a></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

   }</div>


  </div>


  <div class="section" id="ds-queue.constants">
   <h2 class="title">预定义常量</h2>
   <dl>

    
     <dt id="ds-queue.constants.min-capacity"><strong><code><a href="class.ds-queue.php#ds-queue.constants.min-capacity">Ds\Queue::MIN_CAPACITY</a></code></strong></dt>
     <dd>
      <p class="para"/>
     </dd>
    

   </dl>
  </div>


  <div class="section">
   <h2 class="title">更新日志</h2>
   <p class="para">
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>版本</th>
        <th>说明</th>
       </tr>

      </thead>

      <tbody class="tbody">
       <tr>
        <td>PECL ds 1.3.0</td>
        <td>
         The class now implements <span class="classname"><a href="class.arrayaccess.php" class="classname">ArrayAccess</a></span>.
        </td>
       </tr>

      </tbody>
     
    </table>

   </p>
  </div>

 </div>

 




















































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="ds-queue.allocate.php">Ds\Queue::allocate</a> — Allocates enough memory for a required capacity</li><li><a href="ds-queue.capacity.php">Ds\Queue::capacity</a> — Returns the current capacity</li><li><a href="ds-queue.clear.php">Ds\Queue::clear</a> — Removes all values</li><li><a href="ds-queue.construct.php">Ds\Queue::__construct</a> — Creates a new instance</li><li><a href="ds-queue.copy.php">Ds\Queue::copy</a> — Returns a shallow copy of the queue</li><li><a href="ds-queue.count.php">Ds\Queue::count</a> — Returns the number of values in the queue</li><li><a href="ds-queue.isempty.php">Ds\Queue::isEmpty</a> — Returns whether the queue is empty</li><li><a href="ds-queue.jsonserialize.php">Ds\Queue::jsonSerialize</a> — Returns a representation that can be converted to JSON</li><li><a href="ds-queue.peek.php">Ds\Queue::peek</a> — Returns the value at the front of the queue</li><li><a href="ds-queue.pop.php">Ds\Queue::pop</a> — Removes and returns the value at the front of the queue</li><li><a href="ds-queue.push.php">Ds\Queue::push</a> — Pushes values into the queue</li><li><a href="ds-queue.toarray.php">Ds\Queue::toArray</a> — Converts the queue to an array</li></ul>
</div>
<?php manual_footer($setup); ?>