Packagecom.gestureworks.cml.utils
Classpublic class List
InheritanceList Inheritance flash.utils.Proxy
Implements IList, IListIterator

The List utility is a data structure that creates an ordered list, has a built-in two-way iterator, and contains many options for storing and retreiving values.

The structure is comprised of:

        var l:List = new List();
        l.append(new Sprite());
        l.append(new TouchSprite());
        
        l.reset();
        trace(l.next());     
     
     

See also

LinkedMap


Public Properties
 PropertyDefined By
  currentIndex : int
Returns and sets the current index
List
  currentValue : *
[read-only] Returns the current value
List
  index : int
Returns and sets the current index
List
  length : int
[read-only] Returns the length of list
List
  value : *
Returns the current value
List
Public Methods
 MethodDefined By
  
Constructor
List
  
append(value:*):void
Appends a value to the list
List
  
getIndex(index:int):*
Returns the value by index
List
  
hasIndex(index:int):Boolean
Returns true if a value exists for the index
List
  
hasNext():Boolean
Returns true if the iteration can return one more than the current index
List
  
hasPrev():Boolean
Returns true if the iteration can return one less than the current index
List
  
insert(index:int, value:*):void
Inserts a new value by index
List
  
next():*
Returns the next value
List
  
prepend(value:*):void
Prepends a value to the list
List
  
prev():*
Returns the previous index
List
  
remove(index:int):void
Removes a value by index
List
  
replace(index:int, value:String):void
Replaces value by index
List
  
reset():void
Resets the current index to zero
List
  
search(value:*):int
Searches by value and returns the first index that matches the value
List
  
searchAll(value:*):Array
Searches by value and returns all found indices in an ordered array
List
  
selectIndex(index:int):*
Returns a value by index and increments the current index to the provided index parameter
List
  
toArray():Array
Returns the previous index
List
Protected Methods
 MethodDefined By
  
deleteProperty(name:*):Boolean
[override]
List
  
getProperty(name:*):*
[override]
List
  
hasProperty(name:*):Boolean
[override]
List
  
nextName(index:int):String
[override]
List
  
nextNameIndex(index:int):int
[override]
List
  
nextValue(index:int):*
[override]
List
Property Detail
currentIndexproperty
currentIndex:int

Returns and sets the current index


Implementation
    public function get currentIndex():int
    public function set currentIndex(value:int):void
currentValueproperty 
currentValue:*  [read-only]

Returns the current value


Implementation
    public function get currentValue():*
indexproperty 
index:int

Returns and sets the current index


Implementation
    public function get index():int
    public function set index(value:int):void
lengthproperty 
length:int  [read-only]

Returns the length of list


Implementation
    public function get length():int
valueproperty 
value:*

Returns the current value


Implementation
    public function get value():*
    public function set value(value:any):void
Constructor Detail
List()Constructor
public function List()

Constructor

Method Detail
append()method
public function append(value:*):void

Appends a value to the list

Parameters

value:*

deleteProperty()method 
override flash_proxy function deleteProperty(name:*):Boolean

Parameters

name:*

Returns
Boolean
getIndex()method 
public function getIndex(index:int):*

Returns the value by index

Parameters

index:int

Returns
*
getProperty()method 
override flash_proxy function getProperty(name:*):*

Parameters

name:*

Returns
*
hasIndex()method 
public function hasIndex(index:int):Boolean

Returns true if a value exists for the index

Parameters

index:int

Returns
Boolean
hasNext()method 
public function hasNext():Boolean

Returns true if the iteration can return one more than the current index

Returns
Boolean
hasPrev()method 
public function hasPrev():Boolean

Returns true if the iteration can return one less than the current index

Returns
Boolean
hasProperty()method 
override flash_proxy function hasProperty(name:*):Boolean

Parameters

name:*

Returns
Boolean
insert()method 
public function insert(index:int, value:*):void

Inserts a new value by index

Parameters

index:int
 
value:*

next()method 
public function next():*

Returns the next value

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

Parameters

index:int

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

Parameters

index:int

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

Parameters

index:int

Returns
*
prepend()method 
public function prepend(value:*):void

Prepends a value to the list

Parameters

value:*

prev()method 
public function prev():*

Returns the previous index

Returns
*
remove()method 
public function remove(index:int):void

Removes a value by index

Parameters

index:int

replace()method 
public function replace(index:int, value:String):void

Replaces value by index

Parameters

index:int
 
value:String

reset()method 
public function reset():void

Resets the current index to zero

search()method 
public function search(value:*):int

Searches by value and returns the first index that matches the value

Parameters

value:*

Returns
int
searchAll()method 
public function searchAll(value:*):Array

Searches by value and returns all found indices in an ordered array

Parameters

value:*

Returns
Array
selectIndex()method 
public function selectIndex(index:int):*

Returns a value by index and increments the current index to the provided index parameter

Parameters

index:int

Returns
*
toArray()method 
public function toArray():Array

Returns the previous index

Returns
Array