T - element typepublic interface ZList<T> extends ZCollection<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int index,
T value)
Adds a value at the specified index.
|
default boolean |
contains(T value)
Checks if the collection contains the given element.
|
default ZList<T> |
filter(Predicate<T> predicate)
Returns a copy of this list, containing all values that match the given
filter.
|
static <T> ZList<T> |
fixed(T[] array)
Creates an immutable list from the given array.
|
T |
get(int index)
Gets the element at the specified index.
|
int |
indexOf(T value)
Finds the first index of the given value.
|
int |
lastIndexOf(T value)
Finds the last index of the given value.
|
default <U> ZList<U> |
map(java.lang.Class<U> type,
Function<T,U> converter)
Returns a copy of this list, containing all original values converted
with the given function.
|
T |
remove(int index)
Removes the element at the specified index.
|
T |
set(int index,
T value)
Sets the index at the specified index.
|
default WatchedList<T> |
watch()
Creates a watched list, which allows event listeners to be registered
whenever the list has been modified.
|
add, addAll, clear, containsAll, getElementClass, isEmpty, mapLive, mapLive, reduce, remove, removeAll, size, toArraystatic <T> ZList<T> fixed(T[] array)
T - element typearray - array to wrapboolean add(int index,
T value)
index - index to add atvalue - value to addT remove(int index)
index - index to remove atT get(int index)
index - index to retrieveT set(int index, T value)
index - index to set atvalue - new valueint indexOf(T value)
value - value to findint lastIndexOf(T value)
value - value to finddefault <U> ZList<U> map(java.lang.Class<U> type, Function<T,U> converter)
map in interface ZCollection<T>U - resulting element typetype - element classconverter - conversion functiondefault ZList<T> filter(Predicate<T> predicate)
filter in interface ZCollection<T>predicate - predicate to usedefault boolean contains(T value)
ZCollectioncontains in interface ZCollection<T>value - value to check the collection fordefault WatchedList<T> watch()