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.
length:uint [read-only]
The number of items in the PriorityArray
Implementation
public function get length():uint
public function PriorityArray()
Then constructor function is used to create a PriorityArray
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
|
public function clear():void
Empties the PriorityArray. After calling this method the PriorityArray
contains no items.
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.
|
flash_proxy override function getProperty(name:*):*
Provides Array access to read values from the PriorityArray
Parameters
Returns
flash_proxy override function nextName(index:int):StringParameters
Returns
flash_proxy override function nextNameIndex(index:int):intParameters
Returns
flash_proxy override function nextValue(index:int):*Parameters
Returns
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
|
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
|
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
© Big Room Ventures Ltd. 2008