public interface List<E>
Lists. List.List.| Modifier and Type | Method and Description |
|---|---|
List<E> |
add(E e)
Add an element to this
List and return a fresh list containing it. |
E |
get(int index)
Return the element at index given.
|
List<E> |
merge(List<E> e1,
List<E> e2)
Merge two lists into one.
|
List<E> |
piece(int from,
int to)
Piece out the list and return the piece between two indices.
|
List<E> |
remove(E e)
Creates a fresh
List without the first occurrence of e. |
Tuple2<List<E>,List<E>> |
splitAt(int x)
Splits the list at an index
x into two pieces. |
List<E> |
update(int index,
E e)
Update element at an index to this
List and return a fresh list containing it. |
List<E> add(E e)
List and return a fresh list containing it.e - ListList<E> update(int index, E e)
List and return a fresh list containing it. Implementations should maintain the List remain immutable.index - e - ListList<E> remove(E e)
List without the first occurrence of e.List without eE get(int index)
index - List<E> piece(int from, int to)
from - - start index inclusiveto - - end index exclusiveList between `from`(inclusive) and `to`(exclusive).Tuple2<List<E>,List<E>> splitAt(int x)
x into two pieces.x - Tuple2,List>
a tuple of two listsCopyright © 2017. All rights reserved.