| Constructor and Description |
|---|
Array()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(E element)
Appends an element to the end of the Array.
|
Array<E> |
filter(java.util.function.Predicate<E> predicate)
Filter this Array by a given Predicate.
|
E |
get(int index)
Get the element at a specific index.
|
Iterator<E> |
iterator()
Return an iterator for this Array.
|
<O> Array<O> |
map(java.util.function.Function<E,O> toMap)
Apply a function to each element of the Array, and return an Array of the returned elements.
|
void |
remove(int index)
Removes an element at a specific index and shrinks the Array.
|
void |
set(int index,
E element)
Sets the element at a specific index.
|
int |
size()
Returns the size of the Array.
|
void |
sort(Comparator<E> comparator)
Perform an in-place sorting of the elements in the Array.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic int size()
public void append(E element)
element - The element to append.public void set(int index,
E element)
OutOfBoundsException will be thrown.index - The target index.element - The element to be set.public void remove(int index)
OutOfBoundsException will be thrown.index - The index of the element to remove.public <O> Array<O> map(java.util.function.Function<E,O> toMap)
O - The type of the objects stored in the returned Array.toMap - The function to apply to objects stored in the Array.public E get(int index)
index - The index of the requested element.public Array<E> filter(java.util.function.Predicate<E> predicate)
predicate - The predicate on which to filter this Array.public void sort(Comparator<E> comparator)
comparator - The comparator on which to base the ordering.Copyright © 2019. All rights reserved.