Vector, a List implemented based on Array
protected var _elements:Array
public function Vector()
public function append(obj:*, index:int = -1):void
Append the object to the Vector
Parameters
| obj:* — the object to append
|
| |
| index:int (default = -1) — where to append, if omited, appedn to the last position.
|
public function appendAll(arr:Array, index:int = -1):voidParameters
| arr:Array |
| |
| index:int (default = -1) |
public function appendList(list:List, index:int = -1):voidParameters
| list:List |
| |
| index:int (default = -1) |
public function clear():void
public function clone():Vector
Returns
public function contains(obj:*):BooleanParameters
Returns
public function each(operation:Function):void
Call the operation by pass each element once.
for example:
//hide all component in vector components
components.each(
function(c:Component){
c.setVisible(false);
});
Parameters
| operation:Function — the operation function for each element
|
public function eachWithout(obj:Object, operation:Function):void
Call the operation by pass each element once without the specified element.
for example:
//hide all component in vector components without firstOne component
var firstOne:Component = the first one;
components.eachWithout(
firstOne,
function(c:Component){
c.setVisible(false);
});
Parameters
| obj:Object — the which will not be operated.
|
| |
| operation:Function — the operation function for each element
|
public function elementAt(i:int):*Parameters
Returns
public function first():*
Returns
public function get(i:int):*Parameters
Returns
public function getSize():int
Returns
public function indexOf(obj:*):intParameters
Returns
public function isEmpty():Boolean
Returns
public function last():*
Returns
public function lastIndexOf(obj:*):intParameters
Returns
public function pop():*
Returns
public function remove(obj:*):*Parameters
Returns
public function removeAt(index:int):*Parameters
Returns
public function removeRange(fromIndex:int, toIndex:int):Array
Removes from this List all of the elements whose index is between fromIndex,
inclusive and toIndex inclusive. Shifts any succeeding elements to the left (reduces their index).
This call shortens the ArrayList by (toIndex - fromIndex) elements. (If toIndex less than fromIndex,
this operation has no effect.)
Parameters
| fromIndex:int |
| |
| toIndex:int |
Returns
| Array — the elements were removed from the vector
|
public function replaceAt(index:int, obj:*):*Parameters
Returns
public function setElementAt(index:int, element:*):voidParameters
public function shift():*
Returns
public function size():int
Returns
public function sort(compare:Object, options:int):ArrayParameters
| compare:Object |
| |
| options:int |
Returns
public function sortOn(key:Object, options:int):ArrayParameters
Returns
public function subArray(startIndex:int, length:int):Array
Returns a array that contains elements start with startIndex and has length elements.
Parameters
| startIndex:int — the element started index(include)
|
| |
| length:int — length of the elements, if there is not enough elements left, return the elements ended to the end of the vector.
|
Returns
public function toArray():Array
Returns
public function toString():String
Returns
public static const CASEINSENSITIVE:int = 1
public static const DESCENDING:int = 2
public static const NUMERIC:int = 16
public static const RETURNINDEXEDARRAY:int = 8
public static const UNIQUESORT:int = 4