Initializer
CeylonMutableList(JList<Element> list)
Inherited Attributes
Attributes inherited from: CeylonCollection<Element>
Attributes inherited from: CeylonList<Element>
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 actual void add(Element element)

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

clearSource Codeshared actual void clear()

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

cloneSource Codeshared actual MutableList<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 CeylonList.clone ultimately refines Collection.clone
deleteSource Codeshared actual 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.

Refines MutableList.delete ultimately refines ListMutator.delete
deleteMeasureSource Codeshared actual 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 actual void deleteSpan(Integer from, Integer to)

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

findAndRemoveFirstSource Codeshared actual Element? findAndRemoveFirst(Boolean selecting(Element 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.

findAndRemoveLastSource Codeshared actual Element? findAndRemoveLast(Boolean selecting(Element 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.

findAndReplaceFirstSource Codeshared actual Element? findAndReplaceFirst(Boolean selecting(Element 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.

findAndReplaceLastSource Codeshared actual Element? findAndReplaceLast(Boolean selecting(Element 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.

infillSource Codeshared actual void infill(Element replacement)

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

Refines MutableList.infill ultimately refines ListMutator.infill
insertSource Codeshared actual void insert(Integer index, Element element)

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

pruneSource Codeshared actual Integer prune()

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

Refines MutableList.prune ultimately refines ListMutator.prune
removeSource Codeshared actual Integer remove(Element 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().

Refines MutableList.remove ultimately refines ListMutator.remove
removeFirstSource Codeshared actual Boolean removeFirst(Element 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 Boolean removeLast(Element 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 actual Integer removeWhere(Boolean selecting(Element element))

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

replaceSource Codeshared actual Integer replace(Element 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().

Refines MutableList.replace ultimately refines ListMutator.replace
replaceFirstSource Codeshared actual Boolean replaceFirst(Element 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 Boolean replaceLast(Element 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 actual Integer replaceWhere(Boolean selecting(Element element), Element replacement)

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

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

Set the item associated with the given index to the given item, replacing the item previously associated with this index.

For any instance c of IndexedCorrespondenceMutator, c.set(index, item) may be written using the item and assignment operators:

c[index] = item
truncateSource Codeshared actual 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.

Inherited Methods
Methods inherited from: CeylonCollection<Element>
Methods inherited from: CeylonList<Element>
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: MutableList<Element>
Methods inherited from: Ranged<Index,Element,Subrange>