structs.Queue Extends
Class for FIFO Queue data structure.

Inheritance

Constructor

goog.structs.Queue()

Instance Methods

Public Protected Private
clear()
Removes all elements from the queue.
code »
contains(obj) boolean
Returns true if the given value is in the queue.
Arguments:
obj : T
The value to look for.
Returns: boolean  Whether the object is in the queue.
code »
dequeue() T
Retrieves and removes the head of this queue.
Returns: T  The element at the head of this queue. Returns undefined if the queue is empty.
code »
enqueue(element)
Puts the specified element on this queue.
Arguments:
element : T
The element to be added to the queue.
code »
getCount() number
Returns the number of elements in this queue.
Returns: number  The number of elements in this queue.
code »
getValues() !Array.<T>
Returns all the values in the queue.
Returns: !Array.<T>  An array of the values in the queue.
code »
isEmpty() boolean
Returns true if this queue contains no elements.
Returns: boolean  true if this queue contains no elements.
code »
maybeFlip_()
Flips the back stack onto the front stack if front is empty, to prepare for peek() or dequeue().
code »
peek() T
Retrieves but does not remove the head of this queue.
Returns: T  The element at the head of this queue. Returns undefined if the queue is empty.
code »
remove(obj) boolean
Removes the first occurrence of a particular value from the queue.
Arguments:
obj : T
Object to remove.
Returns: boolean  True if an element was removed.
code »

Instance Properties

back_ :
No description.
Code »
front_ :
No description.
Code »

Package structs

Package Reference