interface List<T>
package polygonal.ds
extends Collection › Hashable
implemented by ArrayList, Dll, Sll
An ordered list of elements
Methods
getRange (fromIndex:Int, toIndex:Int):List<T>
Returns a shallow copy of a range of elements in the interval [fromIndex
, toIndex
).
If toIndex
is negative, the value represents the number of elements.
indexOf (val:T):Int
Returns the index of the first occurrence of val
, or -1 if this list does not contain val
.
insert (index:Int, val:T):Void
Inserts val
at the specified index.
Shifts the element currently at that position (if any) and any subsequent elements to the right (indices + 1).
If index
equals Collection.size
, val
gets appended to the end of the list.