| Package | system.data.queues |
| Class | public class LinearQueue |
| Inheritance | LinearQueue ArrayCollection Object |
| Implements | Queue |
| Subclasses | PriorityQueue |
Example :
import system.data.queues.LinearQueue ;
var q:LinearQueue = new LinearQueue(["item0", "item1"]) ;
trace ("queue size : " + q.size()) ;
trace ("enqueue item2 : " + q.enqueue ("item2")) ;
trace ("enqueue item3 : " + q.enqueue ("item3")) ;
trace ("enqueue item4 : " + q.enqueue ("item4")) ;
trace ("------- element") ;
trace ("element : " + q.element()) ;
trace ("peek : " + q.peek()) ;
trace ("------- dequeue") ;
trace ("dequeue : " + q.dequeue()) ;
trace ("------- iterator") ;
var it = q.iterator() ;
while (it.hasNext())
{
trace (it.next()) ;
}
trace ("queue size : " + q.size() ) ;
trace ("queue toSource : " + q.toSource()) ;
| Method | Defined By | ||
|---|---|---|---|
LinearQueue(init:* = null)
Creates a new LinearQueue instance. | LinearQueue | ||
![]() | add(o:*):Boolean
Inserts an element in the collection. | ArrayCollection | |
![]() | addAll(c:Collection):Boolean
Appends all of the elements in the specified collection to the end of this Collection, in the order that they are returned by the specified collection's iterator (optional operation). | ArrayCollection | |
![]() | clear():void
Removes all elements in the collection. | ArrayCollection | |
clone():* [override]
Returns a shallow copy of this collection (optional operation). | LinearQueue | ||
![]() | contains(o:*):Boolean
Returns true if this collection contains the specified element. | ArrayCollection | |
![]() | containsAll(c:Collection):Boolean
Returns true if this collection contains all of the elements of the specified collection. | ArrayCollection | |
dequeue():Boolean
Retrieves and removes the head of this queue. | LinearQueue | ||
element():*
Retrieves, but does not remove, the head of this queue. | LinearQueue | ||
enqueue(o:*):Boolean
Inserts the specified element into this queue, if possible. | LinearQueue | ||
![]() | equals(o:*):Boolean
Compares the specified object with this object for equality. | ArrayCollection | |
![]() | get(key:*):*
Returns the element from this collection at the passed key index. | ArrayCollection | |
![]() | indexOf(o:*, fromIndex:uint = 0):int
Returns the index of an element in the collection. | ArrayCollection | |
![]() | isEmpty():Boolean
Returns true if this collection contains no elements. | ArrayCollection | |
![]() |
Returns the iterator reference of the object. | ArrayCollection | |
peek():*
Retrieves, but does not remove, the head of this queue, returning null if this queue is empty. | LinearQueue | ||
poll():*
Retrieves and removes the head of this queue. | LinearQueue | ||
![]() | remove(o:*):*
Removes a single instance of the specified element from this collection, if it is present (optional operation). | ArrayCollection | |
![]() | removeAll(c:Collection):Boolean
Removes from this Collection all the elements that are contained in the specified Collection (optional operation). | ArrayCollection | |
![]() | retainAll(c:Collection):Boolean
Retains only the elements in this Collection that are contained in the specified Collection (optional operation). | ArrayCollection | |
![]() | size():uint
Returns the number of elements in this collection. | ArrayCollection | |
![]() | toArray():Array
Returns an array containing all of the elements in this collection. | ArrayCollection | |
![]() | toSource(indent:int = 0):String
Returns the source code string representation of the object. | ArrayCollection | |
![]() | toString():String
Returns the string representation of this instance. | ArrayCollection | |
| LinearQueue | () | Constructor |
public function LinearQueue(init:* = null)Creates a new LinearQueue instance.
Parametersinit:* (default = null) — An optional Array or Collection or Iterable object to fill the collection.
|
| clone | () | method |
override public function clone():*Returns a shallow copy of this collection (optional operation).
Returns* — a shallow copy of this collection.
|
| dequeue | () | method |
public function dequeue():BooleanRetrieves and removes the head of this queue.
ReturnsBoolean |
| element | () | method |
public function element():*Retrieves, but does not remove, the head of this queue.
Returns* |
| enqueue | () | method |
public function enqueue(o:*):BooleanInserts the specified element into this queue, if possible.
Parameters
o:* |
Boolean |
| peek | () | method |
public function peek():*Retrieves, but does not remove, the head of this queue, returning null if this queue is empty.
Returns* |
| poll | () | method |
public function poll():*Retrieves and removes the head of this queue.
Returns* |