ALKMaps.Queue

This class represents a queue

Summary
ALKMaps.QueueThis class represents a queue
Properties
maxSize{Number} the maximum size of the queue.
array of records in the queue.{Array(<Object>)}
currentPosition{Number} the location index in the queue.
Constructor
ALKMaps.QueueCreate a queue.
Functions
cloneClone itself.
currentGet the record at the current location.
firstGet the first record in the queue.
lastGet the last record in the queue.
sizeGet the number of records in the queue.
addAdd record to desired location.
removeRemove the last record.
shiftRangeThe number of records will be removed from the beginning of the array.
clearClear queue data and reset current position.
destroyDestroy this queue

Properties

maxSize

{Number} the maximum size of the queue.  Default tis 100.

array of records in the queue.

{Array(<Object>)}

currentPosition

{Number} the location index in the queue.  Default is -1.

Constructor

ALKMaps.Queue

Create a queue.  Optional queue size can be passed.

Parameters (single argument)

maxSize{Number} Optional maximum queue size.  Default is 100.

Functions

clone

clone:function()

Clone itself.

current

current: function ()

Get the record at the current location.

first

first: function ()

Get the first record in the queue.

last

last: function ()

Get the last record in the queue.

size

size: function ()

Get the number of records in the queue.

add

add: function (record)

Add record to desired location.  Remove records from top to the desired location first.

Parameters

record{Object}

remove

remove: function ()

Remove the last record.

shiftRange

shiftRange: function (count)

The number of records will be removed from the beginning of the array.

Parameters

count{Number} number of records will be removed.

clear

clear: function ()

Clear queue data and reset current position.

destroy

destroy: function ()

Destroy this queue

clone:function()
Clone itself.
current: function ()
Get the record at the current location.
first: function ()
Get the first record in the queue.
last: function ()
Get the last record in the queue.
size: function ()
Get the number of records in the queue.
add: function (record)
Add record to desired location.
remove: function ()
Remove the last record.
shiftRange: function (count)
The number of records will be removed from the beginning of the array.
clear: function ()
Clear queue data and reset current position.
destroy: function ()
Destroy this queue
Close