Class LinkedArrayList
java.lang.Object
io.reactivex.rxjava3.internal.util.LinkedArrayList
A list implementation which combines an ArrayList with a LinkedList to
avoid copying values when the capacity needs to be increased.
The class is non final to allow embedding it directly and thus saving on object allocation.
-
Constructor Summary
ConstructorsConstructorDescriptionLinkedArrayList(int capacityHint) Constructor with the capacity hint of each array segment. -
Method Summary
-
Constructor Details
-
LinkedArrayList
public LinkedArrayList(int capacityHint) Constructor with the capacity hint of each array segment.- Parameters:
capacityHint- the expected number of elements to hold (can grow beyond that)
-
-
Method Details
-
add
Adds a new element to this list.- Parameters:
o- the object to add, nulls are accepted
-
head
Returns the head buffer segment or null if the list is empty.- Returns:
- the head object array
-
size
public int size()Returns the total size of the list.- Returns:
- the total size of the list
-
toString
-