frost.collections

Interface ListWriter<T>

Implemented Interfaces:

A write-only view of a list of elements. ListWriter adds random-access methods to the basic functionality inherited from CollectionWriter.

See also:
ListView
List
Source Code:
View Source
Inherited Fields:

Instance Method Summary

-- indexed assignment operator --
[]:=(index:Int, value:T)
Replaces the element at index with a new value.
insert(index:Int, value:T)
Inserts a new element at index, moving all elements from index to the end of the list out of the way to make room for it.
removeIndex(index:Int):T
Removes the element at index, moving all elements from index + 1 to the end of the list down one index to fill in the "hole" created by the deletion.
removeLast()
Inherited Methods:

Instance Methods

-- indexed assignment operator --
@pre(index >= 0 & index < count)
method []:= (index:Int,
 value:T)

Replaces the element at index with a new value.

Parameters:
index - the element to modify
value - the new value
@pre(index >= 0 & index <= count)
method insert (index:Int,
 value:T)

Inserts a new element at index, moving all elements from index to the end of the list out of the way to make room for it. Inserting with an index equal to count is equivalent to calling add.

Parameters:
index - the location at which to insert
value - the new value
@pre(index >= 0 & index < count)
method removeIndex (index:Int
):T

Removes the element at index, moving all elements from index + 1 to the end of the list down one index to fill in the "hole" created by the deletion.

Parameters:
index - the index to remove
Returns:
the value which was removed
@default
@pre(count > 0)
method removeLast ()