E
- The type of element of this list valuepublic interface ListValue<E> extends CollectionValue<E,List<E>,ListValue<E>,ImmutableListValue<E>>
CollectionValue
that is backed by a List
. All
mutator methods provided are similar to those existing in List
with
the difference of returning itself, for fluency.Modifier and Type | Method and Description |
---|---|
ListValue<E> |
add(int index,
E value)
Adds the specified element at the specified position in the list.
|
ListValue<E> |
add(int index,
Iterable<E> values)
Adds the specified elements in the order that they are iterated
to the list at the specified index.
|
E |
get(int index)
Gets the desired element at the desired index.
|
int |
indexOf(E element)
Queries for the index of the provided element.
|
ListValue<E> |
remove(int index)
Removes the element at the specified position in this list (optional
operation).
|
ListValue<E> |
set(int index,
E element)
Replaces the element at the specified index in this list with the
specified element.
|
add, addAll, asImmutable, contains, containsAll, copy, filter, getAll, isEmpty, remove, removeAll, removeAll, set, size, transform
exists, get, getDefault, getDirect, getKey
forEach, iterator, spliterator
E get(int index)
index
- The index of the element to returnIndexOutOfBoundsException
- if the index is out of rangeListValue<E> add(int index, E value)
index
- The index to add the provided element atvalue
- The element to addListValue<E> add(int index, Iterable<E> values)
index
- The index to add the elements atvalues
- The elements to addListValue<E> remove(int index)
index
- The index of the element to removeListValue<E> set(int index, E element)
index
- The index to replace the element withelement
- The element to setint indexOf(E element)
element
- The element to get the index from