Packageorg.flintparticles.common.utils
Classpublic class PriorityArray
InheritancePriorityArray Inheritance flash.utils.Proxy

A PriorityArray is a collection of values that are permanently sorted according to their priority. When values are added to the PriorityArray their priority is indicated. They are then placed into the Array in sequence according to this priority.

Due to the nature of a PriorityArray, there are no facilities to push, unshift or splice items into the array. All items are added to the PriorityArray using the add method.

The array items can be accessed using standard Array access so the items in the PriorityArray can be looped through in the same manner as a standard Array.



Public Properties
 PropertyDefined by
  length : uint
[read-only] The number of items in the PriorityArray
PriorityArray
Public Methods
 MethodDefined by
  
Then constructor function is used to create a PriorityArray
PriorityArray
  
add(value:*, priority:Number):uint
Adds a value to the PriorityArray.
PriorityArray
  
clear():void
Empties the PriorityArray.
PriorityArray
  
contains(value:*):Boolean
Indicates if the value is in the PriorityArray
PriorityArray
  
remove(value:*):Boolean
Removes the value from the PriorityArray
PriorityArray
  
removeAt(index:uint):*
Removes the item at a particular index from the PriorityArray
PriorityArray
Protected Methods
 MethodDefined by
  
getProperty(name:*):*
Provides Array access to read values from the PriorityArray
PriorityArray
  
nextName(index:int):String
PriorityArray
  
nextNameIndex(index:int):int
PriorityArray
  
nextValue(index:int):*
PriorityArray
  
setProperty(name:*, value:*):void
Used to set the value of an existing member of the PriorityArray.
PriorityArray
Property detail
lengthproperty
length:uint  [read-only]

The number of items in the PriorityArray

Implementation
    public function get length():uint
Constructor detail
PriorityArray()constructor
public function PriorityArray()

Then constructor function is used to create a PriorityArray

Method detail
add()method
public function add(value:*, priority:Number):uint

Adds a value to the PriorityArray.

Parameters
value:* — the value to add
 
priority:Number — the priority to place on the item

Returns
uint — the length of the PriorityArray
clear()method 
public function clear():void

Empties the PriorityArray. After calling this method the PriorityArray contains no items.

contains()method 
public function contains(value:*):Boolean

Indicates if the value is in the PriorityArray

Parameters
value:* — The item to look for in the PriorityArray

Returns
Boolean — true if the item is in the PriorityArray, false if it is not.
getProperty()method 
flash_proxy override function getProperty(name:*):*

Provides Array access to read values from the PriorityArray

Parameters
name:*

Returns
*
nextName()method 
flash_proxy override function nextName(index:int):StringParameters
index:int

Returns
String
nextNameIndex()method 
flash_proxy override function nextNameIndex(index:int):intParameters
index:int

Returns
int
nextValue()method 
flash_proxy override function nextValue(index:int):*Parameters
index:int

Returns
*
remove()method 
public function remove(value:*):Boolean

Removes the value from the PriorityArray

Parameters
value:* — The item to remove from the PriorityArray

Returns
Boolean — true if the item is removed, false if it doesn't exist in the PriorityArray
removeAt()method 
public function removeAt(index:uint):*

Removes the item at a particular index from the PriorityArray

Parameters
index:uint — the index in the PriorityArray of the item to be removed

Returns
* — the item that was removed form the PriorityArray
setProperty()method 
flash_proxy override function setProperty(name:*, value:*):void

Used to set the value of an existing member of the PriorityArray. This method cannot be used to set a new member of the ProiorityArray since this new member won't have a priority setting.

Parameters
name:*
 
value:*