class org.aswing.util.ArrayList

ArrayList, a List implemented based on Array

@author firdosh @author paling

Class Fields

static var CASEINSENSITIVE:Int

static var DESCENDING:Int

static var NUMERIC:Int

static var UNIQUESORT:Int

Instance Fields

function new(): Void

function append(obj:Dynamic, ?index:Int = -1): Void

Append the object to the ArrayList

obj

the object to append

index

where to append, if omited, appedn to the last position.

function appendAll(arr:Array<Dynamic>, ?index:Int = -1): Void

function appendList(list:List, ?index:Int = -1): Void

function clear(): Void

function clone(): ArrayList

function contains(obj:Dynamic): Bool

function each(operation:Dynamic ->Void): 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);
    });

operation

the operation function for each element

function eachWithout(obj:Dynamic, operation:Dynamic ->Void): Void

Call the operation by pass each element once without the specified element.

for example:

//hide all component in list components without firstOne component
var firstOne:Component = the first one;
components.eachWithout( 

   firstOne,

function(c:Component){ c.setVisible(false); });

obj

the which will not be operated.

operation

the operation function for each element

function elementAt(i:Int): Dynamic

function first(): Dynamic

function get(i:Int): Dynamic

function getSize(): Int

function indexOf(obj:Dynamic): Int

function isEmpty(): Bool

function last(): Dynamic

function lastIndexOf(obj:Dynamic): Int

function pop(): Dynamic

function remove(obj:Dynamic): Dynamic

function removeAt(index:Int): Dynamic

function removeRange(fromIndex:Int, toIndex:Int): Array<Dynamic>

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.)

returns

the elements were removed from the vector

function replaceAt(index:Int, obj:Dynamic): Dynamic

function setElementAt(index:Int, element:Dynamic): Void

function shift(): Dynamic

function size(): Int

function sort(compare:Dynamic ->Dynamic ->Intoptions:Int): Array<Dynamic>

function sortOn(compare:Dynamic ->Dynamic ->Intoptions:Int): Array<Dynamic>

function subArray(startIndex:Int, length:Int): Array<Dynamic>

Returns a array that contains elements start with startIndex and has length elements.

startIndex

the element started index(include)

length

length of the elements, if there is not enough elements left, return the elements ended to the end of the vector.

function toArray(): Array<Dynamic>

function toString(): String