| Package | de.polygonal.ds |
| Class | public class ArrayedQueue |
| Inheritance | ArrayedQueue Object |
| Implements | Collection |
See also
| Property | Defined By | ||
|---|---|---|---|
| maxSize : int [read-only]
The queue's maximum capacity. | ArrayedQueue | ||
| size : int [read-only]
The total number of items. | ArrayedQueue | ||
| Method | Defined By | ||
|---|---|---|---|
ArrayedQueue(size:int)
Initializes a queue object to match the given size. | ArrayedQueue | ||
back():*
Indicates the most recently added item. | ArrayedQueue | ||
clear():void
Clears all items. | ArrayedQueue | ||
contains(obj:*):Boolean
Determines if the collection contains a given item. | ArrayedQueue | ||
dequeue():*
Dequeues and returns the front item. | ArrayedQueue | ||
dispose():void
Deletes the last dequeued item to free it for the garbage collector. | ArrayedQueue | ||
dump():String
Prints out all elements (for debug/demo purposes). | ArrayedQueue | ||
enqueue(obj:*):Boolean
Enqueues some data. | ArrayedQueue | ||
getAt(i:int):*
Reads an item relative to the front index. | ArrayedQueue | ||
Initializes an iterator object pointing to the first item in the
collection. | ArrayedQueue | ||
isEmpty():Boolean
Checks if the collection is empty. | ArrayedQueue | ||
peek():*
Indicates the front item. | ArrayedQueue | ||
setAt(i:int, obj:*):void
Writes an item relative to the front index. | ArrayedQueue | ||
toArray():Array
Converts the collection into an array. | ArrayedQueue | ||
toString():String
Prints out a string representing the current object. | ArrayedQueue | ||
| maxSize | property |
maxSize:int [read-only] The queue's maximum capacity.
public function get maxSize():int| size | property |
size:int [read-only] The total number of items.
public function get size():int| ArrayedQueue | () | Constructor |
public function ArrayedQueue(size:int)Initializes a queue object to match the given size. The size must be a power of two - if not the size is automatically rounded to the next largest power of 2. The initial value of all items is null.
Parameterssize:int — The queue's size.
|
| 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.
|
| dispose | () | method |
public function dispose():voidDeletes the last dequeued item to free it for the garbage collector. Use only directly after you have invoked dequeue().
myQueue.dequeue();
myQueue.dispose();
| 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:*):BooleanEnqueues some data.
Parameters
obj:* — The data to enqueue.
|
Boolean — True if the item fits into the queue, otherwise false.
|
| getAt | () | method |
public function getAt(i:int):*Reads an item relative to the front index.
Parameters
i:int — The index of the item.
|
* — The item at the given index.
|
| 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.
|
| setAt | () | method |
public function setAt(i:int, obj:*):voidWrites an item relative to the front index.
Parameters
i:int — The index of the item.
| |
obj:* — The data.
|
| 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.
|