new List(objopt)
An ordered collection. The user of this has precise control over where
in the list each element is inserted. The user can access elements by their integer index (position in the list),
and search for elements in the list.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
object |
<optional> |
- Source:
Methods
add(obj, positionopt)
Inserts the specified element at the specified position in this list (optional operation).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
object | ||
position |
integer |
<optional> |
if not specified object is appended to the end of the list. |
- Source:
addAll(obj, positionopt) → {module:eclairjs.List}
Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
module:eclairjs.List | array | ||
position |
integer |
<optional> |
- Source:
Returns:
- Type
- module:eclairjs.List
clear()
Removes all of the elements from this list (optional operation).
- Source:
contains(obj) → {boolean}
Returns true if this list contains the specified element.
Parameters:
Name | Type | Description |
---|---|---|
obj |
- Source:
Returns:
- Type
- boolean
containsAll(obj) → {boolean}
Returns true if this list contains all of the elements of the specified list or array.
Parameters:
Name | Type | Description |
---|---|---|
obj |
module:eclairjs.List | array |
- Source:
Returns:
- Type
- boolean
equals(obj) → {boolean}
Compares the specified list or array with this list for equality.
Parameters:
Name | Type | Description |
---|---|---|
obj |
module:eclairjs.List | array |
- Source:
Returns:
- Type
- boolean
get(position) → {object}
Returns the element at the specified position in this list.
Parameters:
Name | Type | Description |
---|---|---|
position |
integer |
- Source:
Returns:
- Type
- object
hashCode() → {integer}
Returns the hash code value for this list.
- Source:
Returns:
- Type
- integer
indexOf(obj) → {integer}
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:
Name | Type | Description |
---|---|---|
obj |
object |
- Source:
Returns:
- Type
- integer
isEmpty() → {boolean}
Returns true if this list contains no elements.
- Source:
Returns:
- Type
- boolean
lastIndexOf(obj) → {integer}
Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
Parameters:
Name | Type | Description |
---|---|---|
obj |
- Source:
Returns:
- Type
- integer
remove(positionOrObject) → {boolean}
Removes the element at the specified position in this list (optional operation). or
Removes the first occurrence of the specified element from this list, if it is present (optional operation).
Parameters:
Name | Type | Description |
---|---|---|
positionOrObject |
integer | object |
- Source:
Returns:
- Type
- boolean
removeAll(listOrArray) → {boolean}
Removes from this list all of its elements that are contained in the specified collection (optional operation).
Parameters:
Name | Type | Description |
---|---|---|
listOrArray |
module:eclairjs.List | array |
- Source:
Returns:
- Type
- boolean
retainAll(listOrArray) → {boolean}
Retains only the elements in this list that are contained in the specified collection (optional operation).
Parameters:
Name | Type | Description |
---|---|---|
listOrArray |
module:eclairjs.List | array |
- Source:
Returns:
- Type
- boolean
set(element, position) → {object}
Replaces the element at the specified position in this list with the specified element (optional operation).
Parameters:
Name | Type | Description |
---|---|---|
element |
object | |
position |
integer |
- Source:
Returns:
- Type
- object
size() → {integer}
Returns the number of elements in this list.
- Source:
Returns:
- Type
- integer
subList(fromIndex, toIndex) → {module:eclairjs.List}
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
Parameters:
Name | Type | Description |
---|---|---|
fromIndex |
integer | |
toIndex |
integer |
- Source:
Returns:
- Type
- module:eclairjs.List