| Package | system.data.lists |
| Class | public class SortedArrayList |
| Inheritance | SortedArrayList ArrayList ArrayCollection Object |
| Implements | Sortable |
| Property | Defined By | ||
|---|---|---|---|
| comparator : Comparator
Determinates the Comparator object used in the map to sort the entries. | SortedArrayList | ||
![]() | modCount : int
This property is a protector used in the ListIterator object of this List. | ArrayList | |
| options : uint
Indicates the options to sort the elements in the list. | SortedArrayList | ||
| Method | Defined By | ||
|---|---|---|---|
SortedArrayList(init:* = null, comp:Comparator = null, opts:uint = 0)
Creates a new SortedArrayList instance. | SortedArrayList | ||
add(o:*):Boolean [override]
Inserts an element in the collection. | SortedArrayList | ||
addAll(c:Collection):Boolean [override]
Appends all of the elements in the specified collection to the end of this Collection, in the order that they are returned by the specified collection's iterator (optional operation). | SortedArrayList | ||
addAt(index:uint, o:*):void [override]
Inserts the specified element at the specified position in this list (optional operation). | SortedArrayList | ||
![]() | clear():void [override]
Removes all elements in the collection. | ArrayList | |
clone():* [override]
Returns a shallow copy of the instance. | SortedArrayList | ||
![]() | contains(o:*):Boolean
Returns true if this collection contains the specified element. | ArrayCollection | |
![]() | containsAll(c:Collection):Boolean
Returns true if this collection contains all of the elements of the specified collection. | ArrayCollection | |
![]() | ensureCapacity(capacity:uint):void
Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument. | ArrayList | |
![]() | equals(o:*):Boolean
Compares the specified object with this object for equality. | ArrayCollection | |
![]() | get(key:*):*
Returns the element from this collection at the passed key index. | ArrayCollection | |
![]() | indexOf(o:*, fromIndex:uint = 0):int
Returns the index of an element in the collection. | ArrayCollection | |
![]() | isEmpty():Boolean
Returns true if this collection contains no elements. | ArrayCollection | |
![]() |
Returns the iterator reference of the object. | ArrayCollection | |
![]() | lastIndexOf(o:*, fromIndex:int = 0x7FFFFFFF):int
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. | ArrayList | |
![]() | listIterator(position:uint = 0):ListIterator
Returns a ListIterator of the elements in this list (in proper sequence). | ArrayList | |
![]() | remove(o:*):* [override]
Removes a single instance of the specified element from this collection, if it is present (optional operation). | ArrayList | |
![]() | removeAll(c:Collection):Boolean
Removes from this Collection all the elements that are contained in the specified Collection (optional operation). | ArrayCollection | |
![]() | removeAt(id:uint, len:int = 1):*
Removes from this list all the elements that are contained between the specific id position and the end of this list (optional operation). | ArrayList | |
![]() | removeRange(fromIndex:uint, toIndex:uint):*
Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive. | ArrayList | |
![]() | retainAll(c:Collection):Boolean
Retains only the elements in this Collection that are contained in the specified Collection (optional operation). | ArrayCollection | |
![]() | set(index:uint, o:*):*
Replaces the element at the specified position in this list with the specified element (optional operation). | ArrayList | |
![]() | size():uint
Returns the number of elements in this collection. | ArrayCollection | |
sort(compare:* = null, opts:uint = 0):Array
Sorts the elements in the list. | SortedArrayList | ||
sortOn(fieldName:*, opts:* = null):Array
Sorts the elements in the list according to one or more fields in the array. | SortedArrayList | ||
![]() |
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. | ArrayList | |
![]() | toArray():Array
Returns an array containing all of the elements in this collection. | ArrayCollection | |
![]() | toSource(indent:int = 0):String
Returns the source code string representation of the object. | ArrayCollection | |
![]() | toString():String
Returns the string representation of this instance. | ArrayCollection | |
| comparator | property |
comparator:ComparatorDeterminates the Comparator object used in the map to sort the entries.
public function get comparator():Comparator public function set comparator(value:Comparator):void| options | property |
options:uintIndicates the options to sort the elements in the list.
public function get options():uint public function set options(value:uint):void| SortedArrayList | () | Constructor |
public function SortedArrayList(init:* = null, comp:Comparator = null, opts:uint = 0)Creates a new SortedArrayList instance.
Example :
import system.data.lists.SortedArrayList ;
import system.comparators.AlphaComparator ;
import system.comparators.NumberComparator ;
trace( "-----" ) ;
var list:SortedArrayList ;
list = new SortedArrayList( [ 4 , 3 , 12, 24 ] ) ;
trace( list ) ;
list.comparator = new NumberComparator() ;
trace( list ) ;
trace( "-----" ) ;
list = new SortedArrayList( ["pink" , "red" , "blue" , "black" ] ) ;
trace( list ) ;
list.sort( new AlphaComparator() ) ;
trace( list ) ;
Parameters init:* (default = null) — An optional Array or Collection or Iterable object to fill the collection. This parameter can be an uint value to determinates the default capacity of the list.
| |
comp:Comparator (default = null) — The Comparator object used in the map to sort the entries.
| |
opts:uint (default = 0) — The options to sort the elements in the list.
|
| add | () | method |
override public function add(o:*):BooleanInserts an element in the collection.
Parameters
o:* |
Boolean |
| addAll | () | method |
override public function addAll(c:Collection):BooleanAppends all of the elements in the specified collection to the end of this Collection, in the order that they are returned by the specified collection's iterator (optional operation).
Parameters
c:Collection |
Boolean — true if this list changed as a result of the call.
|
| addAt | () | method |
override public function addAt(index:uint, o:*):voidInserts the specified element at the specified position in this list (optional operation).
Parameters
index:uint | |
o:* |
| clone | () | method |
override public function clone():*Returns a shallow copy of the instance.
Returns* — a shallow copy of the instance.
|
| sort | () | method |
public function sort(compare:* = null, opts:uint = 0):ArraySorts the elements in the list.
Parameters
compare:* (default = null) | |
opts:uint (default = 0) |
Array |
| sortOn | () | method |
public function sortOn(fieldName:*, opts:* = null):ArraySorts the elements in the list according to one or more fields in the array.
Parameters
fieldName:* — A string that identifies a field to be used as the sort value, or an array in which the first element represents the primary sort field, the second represents the secondary sort field, and so on.
| |
opts:* (default = null) — One or more numbers or names of defined constants, separated by the bitwise OR (|) operator, that change the sorting behavior. The following values are acceptable for the options parameter:
|
Array — The return value depends on whether you pass any parameters : |