T - element typepublic class ZArrayList<T> extends java.lang.Object implements ZList<T>
| Constructor and Description |
|---|
ZArrayList(java.lang.Class<T> type) |
ZArrayList(java.lang.Class<T> type,
int initialSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int index,
T value)
Adds a value at the specified index.
|
boolean |
add(T value)
Adds an element to the collection.
|
void |
clear()
Removes all elements from this collection.
|
void |
forEach(java.util.function.Consumer<? super T> consumer) |
T |
get(int index)
Gets the element at the specified index.
|
java.lang.Class<T> |
getElementClass()
Returns the collection's element class.
|
int |
indexOf(T value)
Finds the first index of the given value.
|
boolean |
isEmpty()
Checks if this collection is empty.
|
java.util.Iterator<T> |
iterator() |
int |
lastIndexOf(T value)
Finds the last index of the given value.
|
T |
remove(int index)
Removes the element at the specified index.
|
boolean |
remove(T value)
Removes an element from the collection.
|
boolean |
removeAll(Predicate<T> predicate)
Removes all objects matching the given predicate.
|
T |
set(int index,
T value)
Sets the index at the specified index.
|
int |
size()
Returns the size of this collection.
|
T[] |
toArray()
Converts this collection to an array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontains, empty, filter, first, first, fixed, last, last, map, watchpublic ZArrayList(java.lang.Class<T> type)
public ZArrayList(java.lang.Class<T> type, int initialSize)
public T get(int index)
ZListpublic T set(int index, T value)
ZListpublic int indexOf(T value)
ZListpublic int lastIndexOf(T value)
ZListlastIndexOf in interface ZList<T>value - value to findpublic java.lang.Class<T> getElementClass()
ZCollectiongetElementClass in interface ZCollection<T>public boolean add(T value)
ZCollectionadd in interface ZCollection<T>value - value to be addedpublic boolean add(int index,
T value)
ZListpublic boolean remove(T value)
ZCollectionremove in interface ZCollection<T>value - value to be removedpublic T remove(int index)
ZListpublic boolean removeAll(Predicate<T> predicate)
ZCollectionremoveAll in interface ZCollection<T>predicate - predicate to check which objects should be removedpublic int size()
ZCollectionsize in interface ZCollection<T>public boolean isEmpty()
ZCollectionisEmpty in interface ZCollection<T>public void clear()
ZCollectionclear in interface ZCollection<T>public void forEach(java.util.function.Consumer<? super T> consumer)
forEach in interface java.lang.Iterable<T>public T[] toArray()
ZCollectiontoArray in interface ZCollection<T>