Packageorg.aswing.util
Classpublic class Vector
ImplementsList
SubclassesStack

Vector, a List implemented based on Array



Protected Properties
 PropertyDefined by
  _elements : Array
Vector
Public Methods
 MethodDefined by
  
Vector
  
append(obj:*, index:int = -1):void
Append the object to the Vector
Vector
  
appendAll(arr:Array, index:int = -1):void
Vector
  
appendList(list:List, index:int = -1):void
Vector
  
clear():void
Vector
  
Vector
  
contains(obj:*):Boolean
Vector
  
each(operation:Function):void
Call the operation by pass each element once.
Vector
  
eachWithout(obj:Object, operation:Function):void
Call the operation by pass each element once without the specified element.
Vector
  
elementAt(i:int):*
Vector
  
first():*
Vector
  
get(i:int):*
Vector
  
getSize():int
Vector
  
indexOf(obj:*):int
Vector
  
isEmpty():Boolean
Vector
  
last():*
Vector
  
lastIndexOf(obj:*):int
Vector
  
pop():*
Vector
  
remove(obj:*):*
Vector
  
removeAt(index:int):*
Vector
  
removeRange(fromIndex:int, toIndex:int):Array
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex inclusive.
Vector
  
replaceAt(index:int, obj:*):*
Vector
  
setElementAt(index:int, element:*):void
Vector
  
shift():*
Vector
  
size():int
Vector
  
sort(compare:Object, options:int):Array
Vector
  
sortOn(key:Object, options:int):Array
Vector
  
subArray(startIndex:int, length:int):Array
Returns a array that contains elements start with startIndex and has length elements.
Vector
  
toArray():Array
Vector
  
toString():String
Vector
Public Constants
 ConstantDefined by
  CASEINSENSITIVE : int = 1
[static]
Vector
  DESCENDING : int = 2
[static]
Vector
  NUMERIC : int = 16
[static]
Vector
  RETURNINDEXEDARRAY : int = 8
[static]
Vector
  UNIQUESORT : int = 4
[static]
Vector
Property detail
_elementsproperty
protected var _elements:Array
Constructor detail
Vector()constructor
public function Vector()
Method detail
append()method
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.
appendAll()method 
public function appendAll(arr:Array, index:int = -1):voidParameters
arr:Array
 
index:int (default = -1)
appendList()method 
public function appendList(list:List, index:int = -1):voidParameters
list:List
 
index:int (default = -1)
clear()method 
public function clear():void
clone()method 
public function clone():Vector

Returns
Vector
contains()method 
public function contains(obj:*):BooleanParameters
obj:*

Returns
Boolean
each()method 
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
eachWithout()method 
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
elementAt()method 
public function elementAt(i:int):*Parameters
i:int

Returns
*
first()method 
public function first():*

Returns
*
get()method 
public function get(i:int):*Parameters
i:int

Returns
*
getSize()method 
public function getSize():int

Returns
int
indexOf()method 
public function indexOf(obj:*):intParameters
obj:*

Returns
int
isEmpty()method 
public function isEmpty():Boolean

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

Returns
*
lastIndexOf()method 
public function lastIndexOf(obj:*):intParameters
obj:*

Returns
int
pop()method 
public function pop():*

Returns
*
remove()method 
public function remove(obj:*):*Parameters
obj:*

Returns
*
removeAt()method 
public function removeAt(index:int):*Parameters
index:int

Returns
*
removeRange()method 
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
replaceAt()method 
public function replaceAt(index:int, obj:*):*Parameters
index:int
 
obj:*

Returns
*
setElementAt()method 
public function setElementAt(index:int, element:*):voidParameters
index:int
 
element:*
shift()method 
public function shift():*

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

Returns
int
sort()method 
public function sort(compare:Object, options:int):ArrayParameters
compare:Object
 
options:int

Returns
Array
sortOn()method 
public function sortOn(key:Object, options:int):ArrayParameters
key:Object
 
options:int

Returns
Array
subArray()method 
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
Array
toArray()method 
public function toArray():Array

Returns
Array
toString()method 
public function toString():String

Returns
String
Constant detail
CASEINSENSITIVEconstant
public static const CASEINSENSITIVE:int = 1
DESCENDINGconstant 
public static const DESCENDING:int = 2
NUMERICconstant 
public static const NUMERIC:int = 16
RETURNINDEXEDARRAYconstant 
public static const RETURNINDEXEDARRAY:int = 8
UNIQUESORTconstant 
public static const UNIQUESORT:int = 4