Top Description Inners Fields Constructors Methods
io.reactivex.internal.util

public Class AppendOnlyLinkedArrayList<T>

extends Object
Class Inheritance
Type Parameters
<T>
the value type
Imports
org.reactivestreams.Subscriber, io.reactivex.Observer, io.reactivex.functions.*

A linked-array-list implementation that only supports appending and consumption.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
AppendOnlyLinkedArrayList.NonThrowingPredicate<
the value type
T
>

Predicate interface suppressing the exception.

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final Object[]
pack-priv int
pack-priv Object[]

Constructor Summary

AccessConstructor and Description
public
AppendOnlyLinkedArrayList(int
the capacity of each link
capacity
)

Constructs an empty list with a per-link capacity.

Method Summary

Modifier and TypeMethod and Description
public <
the target type
U
>
boolean

Returns:

true if a terminal event has been reached
accept
(Subscriber<? super U>
the subscriber to emit the events to
subscriber
)

Interprets the contents as NotificationLite objects and calls the appropriate Subscriber method.

public <
the target type
U
>
boolean

Returns:

true if a terminal event has been reached
accept
(Observer<? super U>
the observer to emit the events to
observer
)

Interprets the contents as NotificationLite objects and calls the appropriate Observer method.

public void
add(T
the value to append
value
)

Append a non-null value to the list.

public void
forEachWhile(AppendOnlyLinkedArrayList.NonThrowingPredicate<? super T>
the consumer of values that returns true if the forEach should terminate
consumer
)

Loops over all elements of the array until a null element is encountered or the given predicate returns true.

public <
the extra state type
S
>
void
forEachWhile(S
the extra state passed into the consumer
state
,
BiPredicate<? super S, ? super T>
the consumer of values that returns true if the forEach should terminate
consumer
)

Loops over all elements of the array until a null element is encountered or the given predicate returns true.

public void
setFirst(T
the value to set
value
)

Set a value as the first element of the list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

capacityback to summary
pack-priv final int capacity
offsetback to summary
pack-priv int offset
tailback to summary
pack-priv Object[] tail

Constructor Detail

AppendOnlyLinkedArrayListback to summary
public AppendOnlyLinkedArrayList(int capacity)

Constructs an empty list with a per-link capacity.

Parameters
capacity:int

the capacity of each link

Method Detail

acceptback to summary
public <U> boolean accept(Subscriber<? super U> subscriber)

Interprets the contents as NotificationLite objects and calls the appropriate Subscriber method.

Parameters
<U>
the target type
subscriber:Subscriber<? super U>

the subscriber to emit the events to

Returns:boolean

true if a terminal event has been reached

acceptback to summary
public <U> boolean accept(Observer<? super U> observer)

Interprets the contents as NotificationLite objects and calls the appropriate Observer method.

Parameters
<U>
the target type
observer:Observer<? super U>

the observer to emit the events to

Returns:boolean

true if a terminal event has been reached

addback to summary
public void add(T value)

Append a non-null value to the list.

Don't add null to the list!

Parameters
value:T

the value to append

forEachWhileback to summary
public 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.

Parameters
consumer:AppendOnlyLinkedArrayList.NonThrowingPredicate<? super T>

the consumer of values that returns true if the forEach should terminate

Annotations
@SuppressWarnings:unchecked
forEachWhileback to summary
public <S> void forEachWhile(S state, BiPredicate<? super S, ? super T> consumer) throws Exception

Loops over all elements of the array until a null element is encountered or the given predicate returns true.

Parameters
<S>
the extra state type
state:S

the extra state passed into the consumer

consumer:BiPredicate<? super S, ? super T>

the consumer of values that returns true if the forEach should terminate

Annotations
@SuppressWarnings:unchecked
Exceptions
Exception:
if the predicate throws
setFirstback to summary
public void setFirst(T value)

Set a value as the first element of the list.

Parameters
value:T

the value to set

io.reactivex.internal.util back to summary

public Interface AppendOnlyLinkedArrayList.NonThrowingPredicate<T>

extends Predicate<T>
Known Direct Implementers
io.reactivex.processors.BehaviorProcessor.BehaviorSubscription, io.reactivex.subjects.BehaviorSubject.BehaviorDisposable, io.reactivex.subjects.SerializedSubject
Type Parameters
<T>
the value type

Predicate interface suppressing the exception.

Method Summary

Modifier and TypeMethod and Description
public boolean
test(T
the value
t
)

Redeclares io.reactivex.functions.Predicate.test.

Test the given input value and return a boolean.

Method Detail

testback to summary
public boolean test(T t)

Redeclares io.reactivex.functions.Predicate.test.

Doc from io.reactivex.functions.Predicate.test.

Test the given input value and return a boolean.

Parameters
t:T

the value

Returns:boolean

the boolean result

Annotations
@Override