| A list represents a dynamic group of single values that are addressable via a special position number in the list. Lists can be queried and modificated by many different methods. Lists are dynamically because any number of elements can be added at runtime. Parallely the list gets shorter when elements are removed. There are no remaining "empty positions".
List positions are zero based. The first element has position 0.
Lists are used in TMLScript at many places. E.g there is a method this.itemList that retrieves item values as lists.
The TMLScript list equals the java interface "java.util.List".
List.add(value)
Adds the stated value to the end of the list.
List.add(index, value)
Adds the stated value at the quoted position to the list. The element formerly saved to this position as well as all elements behind this position move up.
List.addAll(otherList)
Adds all elements of the list "otherlist" at the end of this list.
List.addAll(index, otherList)
Adds all elements of the list "otherlist" at the quoted index position to the list. The element formerly saved to this index as well as all elements behind move up according to the number of added elements.
List.clear()
Deletes all elements in the list.
List.contains(value) == true|false
Determines if the list contains a certain value.
List.containsAll(otherList) == true|false
Determines if all elements of the list "otherlist" are covered in this list.
List.equals(otherList) = true|false
Determines if the list "otherlist" contains exactly the same content, i.e. the same elements in the same order.
List.get(index)
Evaluates the element on the stated position in the list.
List.indexOf(value)
Evaluates the (first) index of the quoted value in the list.
List.isEmpty() == true|false
Evaluates if the list is empty.
List.lastIndexOf(value)
Evaluates the (last) index of the quoted value in the list.
List.remove(value)
Removes the value of a list, if existent.
List.remove(index)
Removes the element at the quoted position from the list.
List.removeAll(otherList)
Removes all elements of the list "otherlist" from this list as existent.
List.retainAll(otherList)
Removes all elements form this list that are not covered additionally by the list "otherlist".
List.set(index, value)
Replaces the value at the quoted index position. The value previously stored at this position is returned if existent.
List.size()
Returns the number of elements of this list.
List.subList(index1, index2)
Returns a sublist of this list from the element at index1 (inclusive) to the element at index2 (exclusive).
List.toArray()
Converts the list object in a JavaScript array.
Update - New features since WGA 2.2
List = sortList(list)
Sorts the elements of given list.
See: sortList()
List = deleteDoubles(list)
Deletes doubled entries from a list.
|