Packagesystem.data.queues
Classpublic class TypedQueue
InheritanceTypedQueue Inheritance Object
Implements Queue, Typeable, Validator

TypedQueue is a wrapper for Queue instances that ensures that only values of a specific type can be added to the wrapped queue.



Public Properties
 PropertyDefined By
  type : *
Indicates the type of the Typeable object.
TypedQueue
Public Methods
 MethodDefined By
  
TypedQueue(type:*, queue:Queue)
Creates a new TypedQueue instance.
TypedQueue
  
add(o:*):Boolean
Inserts an element in the collection.
TypedQueue
  
clear():void
Removes all elements in the collection.
TypedQueue
  
clone():*
Returns a shallow copy of this collection.
TypedQueue
  
contains(o:*):Boolean
Returns true if this collection contains the specified element.
TypedQueue
  
dequeue():Boolean
Retrieves and removes the head of this queue.
TypedQueue
  
Retrieves, but does not remove, the head of this queue.
TypedQueue
  
enqueue(o:*):Boolean
Inserts the specified element into this queue, if possible.
TypedQueue
  
get(key:*):*
Returns the element from this collection at the passed key index.
TypedQueue
  
indexOf(o:*, fromIndex:uint = 0):int
Returns the index of an element in the collection.
TypedQueue
  
isEmpty():Boolean
Returns true if this collection contains no elements.
TypedQueue
  
Returns an iterator over the elements in this collection.
TypedQueue
  
peek():*
Retrieves, but does not remove, the head of this queue, returning null if this queue is empty.
TypedQueue
  
poll():*
Retrieves and removes the head of this queue.
TypedQueue
  
remove(o:*):*
Removes a single instance of the specified element from this collection, if it is present (optional operation).
TypedQueue
  
size():uint
Returns the number of elements in this collection.
TypedQueue
  
supports(value:*):Boolean
Returns true if the specific value is valid.
TypedQueue
  
toArray():Array
Returns an array containing all of the elements in this collection.
TypedQueue
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
TypedQueue
  
toString(indent:int = 0):String
Returns the String representation of the object.
TypedQueue
  
validate(value:*):void
Evaluates the condition it checks and updates the IsValid property.
TypedQueue
Property Detail
typeproperty
type:*

Indicates the type of the Typeable object.

If the type change the clear() method is invoked.


Implementation
    public function get type():*
    public function set type(value:any):void
Constructor Detail
TypedQueue()Constructor
public function TypedQueue(type:*, queue:Queue)

Creates a new TypedQueue instance.

Parameters
type:* — the type of this Typeable object (a Class or a Function).
 
queue:Queue — The Queue reference of this wrapper.

Throws
ArgumentError — if the type is null or undefined.
 
TypeError — if a value in the passed-in Queue object isn't valid.
Method Detail
add()method
public function add(o:*):Boolean

Inserts an element in the collection.

Parameters

o:*

Returns
Boolean
clear()method 
public function clear():void

Removes all elements in the collection.

clone()method 
public function clone():*

Returns a shallow copy of this collection.

Returns
* — a shallow copy of this collection.
contains()method 
public function contains(o:*):Boolean

Returns true if this collection contains the specified element.

Parameters

o:*

Returns
Booleantrue if this collection contains the specified element.
dequeue()method 
public function dequeue():Boolean

Retrieves and removes the head of this queue.

Returns
Boolean
element()method 
public function element():*

Retrieves, but does not remove, the head of this queue.

Returns
*
enqueue()method 
public function enqueue(o:*):Boolean

Inserts the specified element into this queue, if possible.

Parameters

o:*

Returns
Boolean
get()method 
public function get(key:*):*

Returns the element from this collection at the passed key index.

Parameters

key:*

Returns
* — the element from this collection at the passed key index.
indexOf()method 
public function indexOf(o:*, fromIndex:uint = 0):int

Returns the index of an element in the collection.

Parameters

o:*
 
fromIndex:uint (default = 0)

Returns
int — the index of an element in the collection.
isEmpty()method 
public function isEmpty():Boolean

Returns true if this collection contains no elements.

Returns
Booleantrue if this collection contains no elements.
iterator()method 
public function iterator():Iterator

Returns an iterator over the elements in this collection.

Returns
Iterator — an iterator over the elements in this collection.
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
*
remove()method 
public function remove(o:*):*

Removes a single instance of the specified element from this collection, if it is present (optional operation).

Parameters

o:*

Returns
*
size()method 
public function size():uint

Returns the number of elements in this collection.

Returns
uint — the number of elements in this collection.
supports()method 
public function supports(value:*):Boolean

Returns true if the specific value is valid.

Parameters

value:*

Returns
Booleantrue if the specific value is valid.
toArray()method 
public function toArray():Array

Returns an array containing all of the elements in this collection.

Note: The returned Array is a reference of the internal Array used in the Collection to store the items. It's not a shallow copy of it.

Returns
Array — an array containing all of the elements in this collection.
toSource()method 
public function toSource(indent:int = 0):String

Returns the source code string representation of the object.

Parameters

indent:int (default = 0)

Returns
String — the source code string representation of the object.
toString()method 
public function toString(indent:int = 0):String

Returns the String representation of the object.

Parameters

indent:int (default = 0)

Returns
String — the String representation of the object.
validate()method 
public function validate(value:*):void

Evaluates the condition it checks and updates the IsValid property.

Parameters

value:*