LinkedQueue

LinkedQueue

A queue based on a linked list.  It’s basically a wrapper class for a linked list to provide FIFO-like access.

See Also

ArrayedQueue

Summary
LinkedQueueA queue based on a linked list.
Functions
LinkedQueueInitializes a new queue.
peekIndicates the front item.
backIndicates the most recently added item.
enqueueEnqueues some data.
dequeueDequeues and returns the front item.
contains@inheritDoc
clear@inheritDoc
getIterator@inheritDoc
Properties
size@inheritDoc
Functions
isEmpty@inheritDoc
toArray@inheritDoc
toStringPrints out a string representing the current object.
dumpPrints out all elements (for debug/demo purposes).

Functions

LinkedQueue

public function LinkedQueue(list: SLinkedList = null)

Initializes a new queue.  You can pass an existing singly linked list to provide queue-like access.

Parameters

listAn existing list to become the queue. 

peek

public function peek():*

Indicates the front item.

Returns

The front item or null if the queue is empty. 

back

public function back():*

Indicates the most recently added item.

Returns

The last item in the queue or null if the queue is empty. 

enqueue

public function enqueue(obj: *):void

Enqueues some data.

Parameters

objThe data to enqueue. 

dequeue

public function dequeue():*

Dequeues and returns the front item.

Returns

The front item or null if the queue is empty. 

contains

public function contains(obj: *):Boolean

@inheritDoc

clear

public function clear():void

@inheritDoc

getIterator

public function getIterator():Iterator

@inheritDoc

Properties

size

public function get size():int

@inheritDoc

Functions

isEmpty

public function isEmpty():Boolean

@inheritDoc

toArray

public function toArray():Array

@inheritDoc

toString

public function toString():String

Prints out a string representing the current object.

Returns

A string representing the current object. 

dump

public function dump():String

Prints out all elements (for debug/demo purposes).

Returns

A human-readable representation of the structure. 

A ‘java-style’ collection interface.
public function LinkedQueue(list: SLinkedList = null)
Initializes a new queue.
public function peek():*
Indicates the front item.
public function back():*
Indicates the most recently added item.
public function enqueue(obj: *):void
Enqueues some data.
public function dequeue():*
Dequeues and returns the front item.
public function contains(obj: *):Boolean
@inheritDoc
public function clear():void
@inheritDoc
public function getIterator():Iterator
@inheritDoc
public function get size():int
@inheritDoc
public function isEmpty():Boolean
@inheritDoc
public function toArray():Array
@inheritDoc
public function toString():String
Prints out a string representing the current object.
public function dump():String
Prints out all elements (for debug/demo purposes).
A queue based on an array (circular queue).
Close