T
- the value typepublic class AppendOnlyLinkedArrayList<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
AppendOnlyLinkedArrayList.NonThrowingPredicate<T>
Predicate interface suppressing the exception.
|
Constructor and Description |
---|
AppendOnlyLinkedArrayList(int capacity)
Constructs an empty list with a per-link capacity.
|
Modifier and Type | Method and Description |
---|---|
<U> boolean |
accept(Observer<? super U> observer)
Interprets the contents as NotificationLite objects and calls
the appropriate Observer method.
|
<U> boolean |
accept(org.reactivestreams.Subscriber<? super U> subscriber)
Interprets the contents as NotificationLite objects and calls
the appropriate Subscriber method.
|
void |
add(T value)
Append a non-null value to the list.
|
void |
forEachWhile(AppendOnlyLinkedArrayList.NonThrowingPredicate<? 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)
Loops over all elements of the array until a null element is encountered or
the given predicate returns true.
|
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 forEachWhile(AppendOnlyLinkedArrayList.NonThrowingPredicate<? super T> consumer)
consumer
- the consumer of values that returns true if the forEach should terminatepublic <U> boolean accept(org.reactivestreams.Subscriber<? super U> subscriber)
U
- the target typesubscriber
- the subscriber to emit the events topublic <U> boolean accept(Observer<? super U> observer)
U
- the target typeobserver
- the observer to emit the events topublic <S> void forEachWhile(S state, BiPredicate<? super S,? super T> consumer) throws Exception
S
- the extra state typestate
- the extra state passed into the consumerconsumer
- the consumer of values that returns true if the forEach should terminateException
- if the predicate throwsCopyright © 2018 JBoss by Red Hat. All rights reserved.