Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: Collection<Element>
Attributes inherited from: Correspondence<Key,Item>
Attributes inherited from: Iterable<Element,Absent>
Attributes inherited from: List<Element>
Methods
addSource Codeshared formal void add(Element element)

Add the given element to the end of this list, incrementing the length of the list.

addAllSource Codeshared default void addAll({Element*} elements)

Add the given elements to the end of this list, increasing the length of the list.

clearSource Codeshared default void clear()

Remove every element from this list, leaving an empty list with no elements.

cloneSource Codeshared formal ListMutator<Element> clone()

A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned.

Refines List.clone ultimately refines Collection.clone
deleteSource Codeshared formal Anything delete(Integer index)

Remove the element at the specified index, returning the removed element, if any, or null if there was no such element.

deleteFirstSource Codeshared default Anything deleteFirst()

Remove the element with index 0 from this list, returning the removed element, or null if there was no such element.

deleteLastSource Codeshared default Anything deleteLast()

Remove the element with index size-1 from this list, returning the removed element, or null if there was no such element.

deleteMeasureSource Codeshared default void deleteMeasure(Integer from, Integer length)

Remove every element with an index in the measured range from:length. If length<=0, no elements are removed.

deleteSpanSource Codeshared default void deleteSpan(Integer from, Integer to)

Remove every element with an index in the spanned range from..to.

infillSource Codeshared formal void infill(Element replacement)

Replace all null values in this list with the given replacement value.

Parameters:
  • replacement

    The replacement value

insertSource Codeshared formal void insert(Integer index, Element element)

Insert the given element at the specified index, incrementing the length of the list.

Throws
  • AssertionError

    if the given index is out of bounds, that is, if index<0 or if index>lastIndex+1

insertAllSource Codeshared default void insertAll(Integer index, {Element*} elements)

Insert the given elements at the specified index, growing the length of the list by the number of given elements.

Throws
  • AssertionError

    if the given index is out of bounds, that is, if index<0 or if index>lastIndex+1

moveSource Codeshared formal void move(Integer i, Integer j)

Efficiently move the element of this list at the given source index to the given destination index, shifting every element falling between the two given indices by one position to accommodate the change of position. If the source index is larger than the destination index, elements are shifted toward the end of the list. If the source index is smaller than the destination index, elements are shifted toward the start of the list. If the given indices are identical, no change is made to the list.

Parameters:
  • i

    The source index of the element to move.

  • j

    The destination index to which the element is moved.

Throws
pruneSource Codeshared formal Integer prune()

Remove all null elements from this list, leaving a list with no null elements, returning the number of elements removed.

removeSource Codeshared formal Integer remove(Element&Object element)

Remove all occurrences of the given value from this list, returning the number of elements removed.

To remove just one occurrence of the given value, use removeFirst() or removeLast().

Parameters:
  • element

    The non-null value to remove

removeAllSource Codeshared default Integer removeAll({Element&Object*} elements)

Remove all occurrences of every one of the given values from this list, returning the number of elements removed.

Parameters:
  • elements

    The non-null values to remove

removeFirstSource Codeshared formal Boolean removeFirst(Element&Object element)

Remove the first occurrence of the given value from this list, if any, returning true if the value occurs in the list, or false otherwise.

Parameters:
  • element

    The non-null value to remove

removeLastSource Codeshared formal Boolean removeLast(Element&Object element)

Remove the last occurrence of the given value from this list, if any, returning true if the value occurs in the list, or false otherwise.

Parameters:
  • element

    The non-null value to remove

replaceSource Codeshared formal Integer replace(Element&Object element, Element replacement)

Replace all occurrences of the given value in this list with the given replacement value.

To replace just one occurrence of the given value, use replaceFirst() or replaceLast().

Parameters:
  • element

    The non-null value to replace

  • replacement

    The replacement value

replaceFirstSource Codeshared formal Boolean replaceFirst(Element&Object element, Element replacement)

Replace the first occurrence of the given value in this list, if any, with the given replacement value, returning true if the value occurs in the list, or false otherwise.

Parameters:
  • element

    The non-null value to replace

  • replacement

    The replacement value

replaceLastSource Codeshared formal Boolean replaceLast(Element&Object element, Element replacement)

Replace the last occurrence of the given value in this list, if any, with the given replacement value, returning true if the value occurs in the list, or false otherwise.

Parameters:
  • element

    The non-null value to replace

  • replacement

    The replacement value

setSource Codeshared formal void set(Integer index, Element element)

Replace the existing element at the specified index with the given element.

Throws
  • AssertionError

    if the given index is out of bounds, that is, if index<0 or if index>lastIndex

swapSource Codeshared formal void swap(Integer i, Integer j)

Given two indices within this list, swap the positions of the elements at these indices. If the two given indices are identical, no change is made to the list.

Parameters:
  • i

    The index of the first element.

  • j

    The index of the second element.

Throws
truncateSource Codeshared default void truncate(Integer size)

Truncate this list to the given size by removing elements from the end of the list, if necessary, leaving a list with at most the given size.

Parameters:
  • size
    • size >= 0
Throws
Inherited Methods
Methods inherited from: Object
Methods inherited from: Category<Element>
Methods inherited from: Collection<Element>
Methods inherited from: Correspondence<Key,Item>
Methods inherited from: IndexedCorrespondenceMutator<Element>
Methods inherited from: Iterable<Element,Absent>
Methods inherited from: List<Element>
Methods inherited from: Ranged<Index,Element,Subrange>