Queue Class
+ + + + +A simple FIFO queue. Items are added to the Queue with add(1..n items) and +removed using next().
+Constructor
+Queue
+
+
+ -
+
+
-
+
+
item+ +
+
+
Parameters:
+ +-
+
+
-
+
+
item+ MIXED + + + + multiple + + +++ + +0..n items to seed the queue.
+
+
+
-
+
- Index + + +
- Methods + + +
- Properties + + + +
Methods
+ + +_init
+
+
+ ()
+
+
+
+
+
+
+
+ protected
+
+
+
+
+
+
+
+
+
+
+
+
+ Initialize the queue
+add
+
+
+ -
+
+
-
+
+
item+ +
+
+
Add 0..n items to the end of the queue.
+Parameters:
+ +-
+
+
-
+
+
item+ MIXED + + + + multiple + + +++ + +0..n items.
+
+
+
Returns:
+ +indexOf
+
+
+ -
+
+
-
+
+
needle+ +
+
+
Returns the current index in the queue of the specified item
+Parameters:
+ +-
+
+
-
+
+
needle+ MIXED + + + + +++ + +the item to search for
+
+
+
Returns:
+ +last
+
+
+ ()
+
+
+
+
+ MIXED
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Get the last in the queue. LIFO support.
+Returns:
+ +next
+
+
+ ()
+
+
+
+
+ MIXED
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Get the next item in the queue. FIFO support
+Returns:
+ +promote
+
+
+ -
+
+
-
+
+
item+ +
+
+
Moves the referenced item to the head of the queue
+Parameters:
+ +-
+
+
-
+
+
item+ MIXED + + + + +++ + +an item in the queue
+
+
+
remove
+
+
+ -
+
+
-
+
+
item+ +
+
+
Removes the referenced item from the queue
+Parameters:
+ +-
+
+
-
+
+
item+ MIXED + + + + +++ + +an item in the queue
+
+
+
Properties
+ + +_q
+ Array
+
+
+
+
+ protected
+
+
+
+
+
+
+
+
+ The collection of enqueued items
+