| Package | de.polygonal.ds |
| Class | public class LinkedQueue |
| Inheritance | LinkedQueue Object |
| Implements | Collection |
See also
| Property | Defined By | ||
|---|---|---|---|
| size : int [read-only]
The total number of items. | LinkedQueue | ||
| Method | Defined By | ||
|---|---|---|---|
LinkedQueue(list:SLinkedList = null)
Initializes a new queue. | LinkedQueue | ||
back():*
Indicates the most recently added item. | LinkedQueue | ||
clear():void
Clears all items. | LinkedQueue | ||
contains(obj:*):Boolean
Determines if the collection contains a given item. | LinkedQueue | ||
dequeue():*
Dequeues and returns the front item. | LinkedQueue | ||
dump():String
Prints out all elements (for debug/demo purposes). | LinkedQueue | ||
enqueue(obj:*):void
Enqueues some data. | LinkedQueue | ||
Initializes an iterator object pointing to the first item in the
collection. | LinkedQueue | ||
isEmpty():Boolean
Checks if the collection is empty. | LinkedQueue | ||
peek():*
Indicates the front item. | LinkedQueue | ||
toArray():Array
Converts the collection into an array. | LinkedQueue | ||
toString():String
Prints out a string representing the current object. | LinkedQueue | ||
| size | property |
size:int [read-only] The total number of items.
public function get size():int| LinkedQueue | () | Constructor |
public function LinkedQueue(list:SLinkedList = null)Initializes a new queue. You can pass an existing singly linked list to provide queue-like access.
Parameterslist:SLinkedList (default = null) — An existing list to become the queue.
|
| back | () | method |
public function back():*Indicates the most recently added item.
Returns* — The last item in the queue or null if the queue is empty.
|
| clear | () | method |
public function clear():voidClears all items.
| contains | () | method |
public function contains(obj:*):BooleanDetermines if the collection contains a given item.
Parameters
obj:* — The item to search for.
|
Boolean — True if the item exists, otherwise false.
|
| dequeue | () | method |
public function dequeue():*Dequeues and returns the front item.
Returns* — The front item or null if the queue is empty.
|
| dump | () | method |
public function dump():StringPrints out all elements (for debug/demo purposes).
ReturnsString — A human-readable representation of the structure.
|
| enqueue | () | method |
public function enqueue(obj:*):voidEnqueues some data.
Parameters
obj:* — The data to enqueue.
|
| getIterator | () | method |
public function getIterator():IteratorInitializes an iterator object pointing to the first item in the collection.
ReturnsIterator — An iterator object.
|
| isEmpty | () | method |
public function isEmpty():BooleanChecks if the collection is empty.
ReturnsBoolean — True if empty, otherwise false.
|
| peek | () | method |
public function peek():*Indicates the front item.
Returns* — The front item or null if the queue is empty.
|
| toArray | () | method |
public function toArray():ArrayConverts the collection into an array.
ReturnsArray — An array.
|
| toString | () | method |
public function toString():StringPrints out a string representing the current object.
ReturnsString — A string representing the current object.
|