| Package | org.aswing.util |
| Interface | public interface List |
| Implementors | LinkedList, Vector, VectorListModel |
| Method | Defined by | ||
|---|---|---|---|
|
append(element:*, index:int = -1):void
Inserts the specified element at the specified position in this list.
| List | ||
|
appendAll(arr:Array, index:int = -1):void
Inserts all the elements in a array at the specified position in this list.
| List | ||
|
appendList(list:List, index:int = -1):void
Inserts all the elements in a list at the specified position in this list.
| List | ||
|
clear():void
Removes all of the elements from this list.
| List | ||
|
contains(element:*):Boolean
Returns true if this list contains the specified element.
| List | ||
|
first():*
Returns the first element in the list.
| List | ||
|
get(index:int):*
Returns the element at the specified position in this list.
| List | ||
|
indexOf(element:*):int
Returns the index in this list of the first occurrence of the specified element,
or -1 if this list does not contain this element.
| List | ||
|
isEmpty():Boolean
Returns true if this list contains no elements.
| List | ||
|
last():*
Returns the last element in the list.
| List | ||
|
pop():*
Removes and return the last element in the list.
| List | ||
|
remove(element:*):*
Removes the first occurrence in this list of the specified element.
| List | ||
|
removeAt(index:int):*
Removes the element at the specified position in this list.
| List | ||
|
removeRange(fromIndex:int, toIndex:int):Array
Removes the elements at the specified index range.
| List | ||
|
replaceAt(index:int, element:*):*
Replaces the element at the specified position in this list with the specified element.
| List | ||
|
shift():*
Removes and return the first element in the list.
| List | ||
|
size():int
Returns the number of elements in this list.
| List | ||
|
toArray():Array
Returns an array containing all of the elements in this list in proper sequence.
| List | ||
| append | () | method |
public function append(element:*, index:int = -1):voidInserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
If index is omited, the element will be append to the end of the list. Parameters
element:* — element to be inserted.
|
|
index:int (default = -1) — (optional)at which the specified element is to be inserted.
|
| appendAll | () | method |
public function appendAll(arr:Array, index:int = -1):voidInserts all the elements in a array at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
If index is omited, the elements will be append to the end of the list. Parameters
arr:Array — arr of elements to be inserted.
|
|
index:int (default = -1) — (optional)at which the elements is to be inserted.
|
| appendList | () | method |
public function appendList(list:List, index:int = -1):voidInserts all the elements in a list at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
If index is omited, the elements will be append to the end of the list. Parameters
list:List — arr of elements to be inserted.
|
|
index:int (default = -1) — (optional)at which the elements is to be inserted.
|
| clear | () | method |
public function clear():voidRemoves all of the elements from this list. This list will be empty after this call returns.
| contains | () | method |
public function contains(element:*):BooleanReturns true if this list contains the specified element.
Parameterselement:* — element whose presence in this list is to be tested.
|
Boolean — true if this list contains the specified element.
|
| first | () | method |
public function first():*Returns the first element in the list. Undefined will be return if there is not any elements in the list.
Returns* — the first element in the list.
|
| get | () | method |
public function get(index:int):*Returns the element at the specified position in this list.
Parametersindex:int — index of element to return.
|
* — the element at the specified position in this list. Undefined will be
returned if the index is out of range (index < 0 || index >= size()).
|
| indexOf | () | method |
public function indexOf(element:*):intReturns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. More formally, returns the lowest index.
Parameterselement:* — element to search for.
|
int — the index in this list of the first occurrence of the specified element,
or -1 if this list does not contain this element
|
| isEmpty | () | method |
public function isEmpty():BooleanReturns true if this list contains no elements.
ReturnsBoolean — true if this list contains no elements.
|
| last | () | method |
public function last():*Returns the last element in the list. Undefined will be return if there is not any elements in the list.
Returns* — the last element in the list.
|
| pop | () | method |
public function pop():*Removes and return the last element in the list. Undefined will be return if there is not any elements in the list.
Returns* — the last element in the list.
|
| remove | () | method |
public function remove(element:*):*Removes the first occurrence in this list of the specified element. If this list does not contain the element, it is unchanged. More formally, removes the element with the lowest index.
Parameterselement:* — element to be removed from this list, if present.
|
* — the element removed or undefined there is not such element in the list.
|
| removeAt | () | method |
public function removeAt(index:int):*Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
Parametersindex:int — the index of the element to removed.
|
* — the element previously at the specified position.
|
| removeRange | () | method |
public function removeRange(fromIndex:int, toIndex:int):ArrayRemoves the elements at the specified index range. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the elements in a Array that were removed from the list.
ParametersfromIndex:int — the beginning index to be removed(include).
|
|
toIndex:int — the ending index to be removed(include).
|
Array — the elements were removed.
|
| replaceAt | () | method |
public function replaceAt(index:int, element:*):*Replaces the element at the specified position in this list with the specified element.
Parametersindex:int — index of element to replace.
|
|
element:* — element to be stored at the specified position.
|
* — the element previously at the specified position.
|
| shift | () | method |
public function shift():*Removes and return the first element in the list. Undefined will be return if there is not any elements in the list.
Returns* — the first element in the list.
|
| size | () | method |
public function size():intReturns the number of elements in this list.
Returnsint — the number of elements in this list.
|
| toArray | () | method |
public function toArray():ArrayReturns an array containing all of the elements in this list in proper sequence.
ReturnsArray — an array containing all of the elements in the list.
|