T - the value typepublic class AppendOnlyLinkedArrayList<T>
extends java.lang.Object
| Constructor and Description |
|---|
AppendOnlyLinkedArrayList(int capacity)
Constructs an empty list with a per-link capacity
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(T value)
Append a non-null value to the list.
|
void |
forEach(Consumer<? super T> consumer)
Loops through all elements of the list.
|
void |
forEachWhile(Predicate<? super T> consumer)
Loops over all elements of the array until a null element is encountered or
the given predicate returns true.
|
<S> void |
forEachWhile(S state,
BiPredicate<? super S,? super T> consumer) |
void |
setFirst(T value)
Set a value as the first element of the list.
|
public AppendOnlyLinkedArrayList(int capacity)
capacity - the capacity of each linkpublic void add(T value)
Don't add null to the list!
value - the value to appendpublic void setFirst(T value)
value - the value to setpublic void forEach(Consumer<? super T> consumer)
consumer - the consumer of elementspublic void forEachWhile(Predicate<? super T> consumer)
consumer - the consumer of values that returns true if the forEach should terminatepublic <S> void forEachWhile(S state,
BiPredicate<? super S,? super T> consumer)