class base list[value element type]
extends base readonly list[element type]
implements list[element type]
public overload base list()
pass
public overload base list(element type n1)
this()
append(n1)
public overload base list(element type n1, element type n2)
this()
append(n1)
append(n2)
public overload base list(element type n1, element type n2, element type n3)
this()
append(n1)
append(n2)
append(n3)
public overload base list(readonly list[element type] the list)
this()
append all(the list)
implement void clear()
private list state[element type] writable state()
if !statewritable
state = statecopy()
assert statewritable
return state
implement void append all(readonly list[element type] new elements)
writable state() • insert all(size, new elements)
implement void prepend(element type element)
writable state() • insert(0, element)
implement implicit mutable reference[element type] at(nonnegative index) mutable pure
assert index < statesize
return writable state() • the elements[index]
implement element type remove last()
assert is not empty
assert last index is nonnegative
result : statethe elements[last index]
writable state() • clear(last index, 1)
return result
implement element type remove at(nonnegative index)
assert is not empty
assert index < size
result : the elements[index]
if index != size - 1
rest length : size - index - 1
assert rest length is nonnegative
the elementsmove(index + 1, index, rest length)
assert last index is nonnegative
stateclear(last index, 1)
return result
Sort the list in place using the given sort order.
implement void sort(order[element type] the order)
new statethe elementssort(the order, 0, new statesize)