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
cloneSource Codeshared formal MutableList<Element> clone()

A new list with the same elements as this list.

Refines List.clone ultimately refines Collection.clone
deleteSource Codeshared formal Element? 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 actual default Element? deleteFirst()

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

deleteLastSource Codeshared actual default Element? deleteLast()

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

findAndRemoveFirstSource Codeshared default Element? findAndRemoveFirst(Boolean selecting(Element&Object element))

Remove the first element that satisfies the given predicate function from this list, returning the removed element, or null if no such element was found in this list.

Parameters:
  • selecting

    The predicate function the indexed elements must satisfy.

findAndRemoveLastSource Codeshared default Element? findAndRemoveLast(Boolean selecting(Element&Object element))

Remove the last element that satisfies the given predicate function from this list, returning the removed element, or null if no such element was found in this list.

Parameters:
  • selecting

    The predicate function the indexed elements must satisfy.

findAndReplaceFirstSource Codeshared default Element? findAndReplaceFirst(Boolean selecting(Element&Object element), Element replacement)

Replace the first element of this list that satisfies the given predicate function with the given replacement, returning the replaced element, or null if no such element was found in this list.

Parameters:
  • selecting

    The predicate function the indexed elements must satisfy.

  • replacement

    The replacement value

findAndReplaceLastSource Codeshared default Element? findAndReplaceLast(Boolean selecting(Element&Object element), Element replacement)

Replace the last element of this list that satisfies the given predicate function with the given replacement, returning the replaced element, or null if no such element was found in this list.

Parameters:
  • selecting

    The predicate function the indexed elements must satisfy.

  • replacement

    The replacement value

infillSource Codeshared actual default void infill(Element replacement)

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

moveSource Codeshared actual default 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
    • index may not be negative or greater than the last index in the list

  • j
    • index may not be negative or greater than the last index in the list

pruneSource Codeshared actual default Integer prune()

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

removeSource Codeshared actual default 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 ListMutator.removeFirst() or ListMutator.removeLast().

removeFirstSource Codeshared actual default 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.

removeLastSource Codeshared actual default 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.

removeWhereSource Codeshared default Integer removeWhere(Boolean selecting(Element&Object element))

Remove every element that satisfies the given predicate function from this list, returning the number of elements that were removed.

Parameters:
  • selecting

    The predicate function the indexed elements must satisfy.

replaceSource Codeshared actual default 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 ListMutator.replaceFirst() or ListMutator.replaceLast().

replaceFirstSource Codeshared actual default 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.

replaceLastSource Codeshared actual default 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.

replaceWhereSource Codeshared default Integer replaceWhere(Boolean selecting(Element&Object element), Element replacement)

Replace every element in this list that satisfies the given predicate function with the given replacement.

Parameters:
  • selecting

    The predicate function the indexed elements must satisfy.

  • replacement

    The replacement value

swapSource Codeshared actual default 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
    • index may not be negative or greater than the last index in the list

  • j
    • index may not be negative or greater than the last index in the list

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: ListMutator<Element>
Methods inherited from: Ranged<Index,Element,Subrange>