# Yahoo! UI Library

### yui 3.0.0

Yahoo! UI Library > yui > Queue
Search:
Filters Show Private Show Protected Show Deprecated

## Class Queue

A simple FIFO queue. Items are added to the Queue with add(1..n items) and removed using next().

### Properties

#### _q - `protected {Array}`

The collection of enqueued items

### Methods

#### _init

`protected void _init ( )`
Initialize the queue

#### add

`void add ( item* )`
Add 0..n items to the end of the queue

Parameters:
  `item* <MIXED>` 0..n items

#### indexOf

`Number indexOf ( needle )`
Returns the current index in the queue of the specified item

Parameters:
  `needle <MIXED>` the item to search for

Returns: `Number`
  the index of the item or -1 if not found

#### next

`MIXED next ( )`
Get the next item in the queue.

Returns: `MIXED`
  the next item in the queue

#### promote

`void promote ( item )`
Moves the referenced item to the head of the queue

Parameters:
  `item <MIXED>` an item in the queue

#### remove

`void remove ( item )`
Removes the referenced item from the queue

Parameters:
  `item <MIXED>` an item in the queue

#### size

`Number size ( )`
Returns the current number of queued items

Copyright © 2009 Yahoo! Inc. All rights reserved.