Package | com.yworks.support |
Class | public class YList |
Inheritance | YList flash.utils.Proxy |
Implements | List, Iterable |
Property | Defined By | ||
---|---|---|---|
first : Object [read-only]
Returns the first element in this list. | YList | ||
firstCell : ListCell [read-only]
Returns the first cell in this list. | YList | ||
last : Object [read-only]
Returns the last element in this list. | YList | ||
lastCell : ListCell [read-only]
Returns the last cell in this list. | YList | ||
userObject : Object
Gets or set the user object associated with this list. | YList |
Method | Defined By | ||
---|---|---|---|
YList(array:Array = null)
Creates a new list. | YList | ||
Adds all of the elements in the specified collection to this collection (optional operation). | YList | ||
Inserts Object o at the head of this list. | YList | ||
addFirstCell(cell:ListCell):void
Adds a formerly removed ListCell at the head of this list. | YList | ||
addItem(item:Object):Boolean
Same as addLast()
| YList | ||
Inserts Object o at the tail of this list. | YList | ||
addLastCell(cell:ListCell):void
Adds a formerly removed ListCell at the tail of this list. | YList | ||
clear():void
Removes all of the elements from this collection. | YList | ||
contains(item:Object):Boolean
Returns true if this collection contains the specified element. | YList | ||
Returns the cell where Object o is stored. | YList | ||
Returns the ListCell which can be found at the given index. | YList | ||
getItemAt(i:int):Object
Returns the element at the specified position in this collection. | YList | ||
indexOf(item:Object):int
Returns the index of the first occurrence of the specified element in this list,
or -1 if this list does not contain the element. | YList | ||
insert(item:Object, i:uint):void
Inserts the given item at the given index into the list. | YList | ||
Inserts the given object to this list. | YList | ||
Inserts the given object to this list. | YList | ||
Inserts a formerly removed ListCell at the specified position. | YList | ||
Inserts a formerly removed ListCell at the specified position. | YList | ||
isEmpty():Boolean
Returns true if this collection contains no elements. | YList | ||
Creates an Iterator over this list. | YList | ||
length():uint
Returns the number of elements in this collection. | YList | ||
peek():Object
Equivalent to first
| YList | ||
pop():Object
Removes the first element from this list and returns it. | YList | ||
popLast():Object
Removes the last element from this list and returns it. | YList | ||
Equivalent to addFirst
| YList | ||
removeAt(index:uint):void
Removes the element at the specified position in this list. | YList | ||
removeCell(c:ListCell):Object
Removes the ListCell c and the element stored in it from
this list. | YList | ||
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation). | YList | ||
sort(comparisonFunction:Function = null, sortOptions:int = -1):void
Not yet implemented!
This implementation does nothing
| YList | ||
toArray():Array
Returns an array containing all of the elements in this collection. | YList |
Method | Defined By | ||
---|---|---|---|
getProperty(name:*):* [override]
| YList | ||
nextName(index:int):String [override]
| YList | ||
nextNameIndex(index:int):int [override]
| YList | ||
nextValue(index:int):* [override]
| YList | ||
setProperty(name:*, value:*):void [override]
| YList |
first | property |
first:Object
[read-only] Returns the first element in this list.
Precondition: !isEmpty()
.
public function get first():Object
firstCell | property |
firstCell:ListCell
[read-only] Returns the first cell in this list.
Precondition: !isEmpty()
.
public function get firstCell():ListCell
last | property |
last:Object
[read-only] Returns the last element in this list.
Precondition: !isEmpty()
.
public function get last():Object
lastCell | property |
lastCell:ListCell
[read-only] Returns the last cell in this list.
Precondition: !isEmpty()
.
public function get lastCell():ListCell
userObject | property |
userObject:Object
Gets or set the user object associated with this list.
public function get userObject():Object
public function set userObject(value:Object):void
YList | () | Constructor |
public function YList(array:Array = null)
Creates a new list. If an array is provided, the list is initialized with the elements provided by the given array.
Parametersarray:Array (default = null ) — The array to initialize the list with.
|
addAll | () | method |
public function addAll(iter:Iterable):void
Adds all of the elements in the specified collection to this collection (optional operation).
Parameters
iter:Iterable — the collection containing elements to be added to this collection
|
addFirst | () | method |
public function addFirst(o:Object):ListCell
Inserts Object o
at the head of this list.
Parameters
o:Object |
ListCell — The ListCell where the Object o is stored.
|
addFirstCell | () | method |
public function addFirstCell(cell:ListCell):void
Adds a formerly removed ListCell at the head of this list.
Attention: If the ListCell is still part of a list, this list will be corrupted afterwards.
Parameters
cell:ListCell — A list cell which is not part of any list.
|
addItem | () | method |
public function addItem(item:Object):Boolean
Same as addLast()
Parameters
item:Object |
Boolean |
See also
addLast | () | method |
public function addLast(o:Object):ListCell
Inserts Object o
at the tail of this list.
Parameters
o:Object |
ListCell — the ListCell where the Object o is stored.
|
addLastCell | () | method |
public function addLastCell(cell:ListCell):void
Adds a formerly removed ListCell at the tail of this list.
Attention: If the ListCell is still part of a list, this list will be corrupted afterwards.
Parameters
cell:ListCell — A list cell which is not part of any list.
|
clear | () | method |
public function clear():void
Removes all of the elements from this collection. The collection will be empty after this method returns.
contains | () | method |
public function contains(item:Object):Boolean
Returns true if this collection contains the specified element.
Parameters
item:Object — element whose presence in this collection is to be tested
|
Boolean — true if this collection contains the specified element
|
findCell | () | method |
public function findCell(o:Object):ListCell
Returns the cell where Object o
is stored.
This operation returns null
, if no such cell exists.
Parameters
o:Object |
ListCell |
getCell | () | method |
public function getCell(index:int):ListCell
Returns the ListCell
which can be found at the given index.
Parameters
index:int — The index of the ListCell to return.
|
ListCell — The ListCell at the given index
|
getItemAt | () | method |
public function getItemAt(i:int):Object
Returns the element at the specified position in this collection.
Parameters
i:int — the index of the element to return
|
Object — the element at the specified position in this list
|
getProperty | () | method |
override flash_proxy function getProperty(name:*):*
Parameters
name:* |
* |
indexOf | () | method |
public function indexOf(item:Object):int
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
Parameters
item:Object — the element to search for
|
int — the index of the first occurrence of the specified element in this list,
or -1 if this list does not contain the element
|
insert | () | method |
public function insert(item:Object, i:uint):void
Inserts the given item at the given index into the list.
Creates a new ListCell
, inserts it into the list and
sets the new ListCell
's info
value to the given item.
Parameters
item:Object — The item to insert.
| |
i:uint — The index to insert the item at
|
insertAfter | () | method |
public function insertAfter(o:Object, refCell:ListCell):ListCell
Inserts the given object to this list.
The newly created ListCell will be inserted
to this list immediatelly after refCell.
If refCell == null
the given object is inserted at the head
of the list.
Parameters
o:Object — the object to be inserted
| |
refCell:ListCell — the cell used to reference the position
|
ListCell — the newly created ListCell, which contains o
|
insertBefore | () | method |
public function insertBefore(o:Object, refCell:ListCell):ListCell
Inserts the given object to this list.
The newly created ListCell will be inserted
to this list immediatelly before refCell.
If refCell == null
the given object is appended
to the list.
Parameters
o:Object — the object to be inserted
| |
refCell:ListCell — the cell used to reference the position
|
ListCell — the newly created ListCell, which contains o
|
insertCellAfter | () | method |
public function insertCellAfter(cellToInsert:ListCell, refCell:ListCell):void
Inserts a formerly removed ListCell at the specified position.
Attention: If the ListCell is still part of a list, this list will be corrupted afterwards.
Parameters
cellToInsert:ListCell — A list cell that is not part of any list.
| |
refCell:ListCell — A list cell that is contained in this list.
|
insertCellBefore | () | method |
public function insertCellBefore(cellToInsert:ListCell, refCell:ListCell):void
Inserts a formerly removed ListCell at the specified position.
Attention: If the ListCell is still part of a list, this list will be corrupted afterwards.
Parameters
cellToInsert:ListCell — A list cell that is not part of any other list.
| |
refCell:ListCell — A list cell that is contained in this list
|
isEmpty | () | method |
public function isEmpty():Boolean
Returns true if this collection contains no elements.
ReturnsBoolean — true if this collection contains no elements
|
iterator | () | method |
public function iterator():Iterator
Creates an Iterator
over this list.
Iterator — An Iterator over the elements of this list.
|
length | () | method |
public function length():uint
Returns the number of elements in this collection.
Returnsuint — the number of elements in this collection
|
nextName | () | method |
override flash_proxy function nextName(index:int):String
Parameters
index:int |
String |
nextNameIndex | () | method |
override flash_proxy function nextNameIndex(index:int):int
Parameters
index:int |
int |
nextValue | () | method |
override flash_proxy function nextValue(index:int):*
Parameters
index:int |
* |
peek | () | method |
pop | () | method |
public function pop():Object
Removes the first element from this list and returns it.
ReturnsObject |
popLast | () | method |
public function popLast():Object
Removes the last element from this list and returns it.
ReturnsObject |
push | () | method |
public function push(o:Object):ListCell
Equivalent to addFirst
Parameters
o:Object |
ListCell — The ListCell where the Object o is stored.
|
See also
removeAt | () | method |
public function removeAt(index:uint):void
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).
Parameters
index:uint — the index of the element to be removed
|
removeCell | () | method |
public function removeCell(c:ListCell):Object
Removes the ListCell c
and the element stored in it from
this list.
This operation has time complexity O(1). Precondition: c is a cell of this list.
Parameters
c:ListCell |
Object — The element that was stored in the removed cell
|
removeItem | () | method |
public function removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation).
Parameters
item:Object — element to be removed from this collection, if present
|
Boolean — true if an element was removed as a result of this call
|
setProperty | () | method |
override flash_proxy function setProperty(name:*, value:*):void
Parameters
name:* | |
value:* |
sort | () | method |
public function sort(comparisonFunction:Function = null, sortOptions:int = -1):void
Not yet implemented!
This implementation does nothing
Parameters
comparisonFunction:Function (default = null )
| |
sortOptions:int (default = -1 )
|
toArray | () | method |
public function toArray():Array
Returns an array containing all of the elements in this collection.
ReturnsArray — an array containing all of the elements in this collection
|