Mutable Long List
MutableLongList is a MutableList-like collection for Long values. It allows storing and retrieving the elements without boxing. Immutable access is available through its base class LongList, which has a List-like interface.
This implementation is not thread-safe: if multiple threads access this container concurrently, and one or more threads modify the structure of the list (insertion or removal for instance), the calling code must provide the appropriate synchronization. It is also not safe to mutate during reentrancy -- in the middle of a forEach, for example. However, concurrent reads are safe.
Constructors
Creates a MutableLongList with a capacity of initialCapacity.
Properties
Returns the total number of elements that can be held before the MutableLongList must grow.
Functions
Adds all elements to the end of the MutableLongList and returns true if the MutableLongList was changed or false if elements was empty.
Adds all elements to the MutableLongList at the given index, shifting over any elements at index and after, if any.
Splits this list into a list of InPlaceLongSubList each not exceeding the given chunkSize. The last list may have less elements than the given chunkSize.
Removes all elements in the MutableLongList. The storage isn't released.
Returns the element at the given index or defaultValue if index is out of bounds of the collection.
Ensures that there is enough space to store capacity elements in the MutableLongList.
Iterates through the windows of the list and performs the given action on each window.
Iterates through the windows of the list with their indices and performs the given action on each window.
Returns true if there are elements in the LongList or false if it is empty.
Creates a String from the elements separated by separator and using prefix before and postfix after, if supplied.
Returns an List
Returns a DoubleList containing the results of applying the given transform function to each element in the original LongList.
Returns a FloatList containing the results of applying the given transform function to each element in the original LongList.
Returns a IntList containing the results of applying the given transform function to each element in the original LongList.
Returns a LongList containing the results of applying the given transform function to each element in the original LongList.
Returns a List containing the results of applying the given transform function to each element and its index in the original LongList.
Returns a DoubleList containing the results of applying the given transform function to each element and its index in the original LongList.
Returns a FloatList containing the results of applying the given transform function to each element and its index in the original LongList.
Returns a IntList containing the results of applying the given transform function to each element and its index in the original LongList.
Returns a LongList containing the results of applying the given transform function to each element and its index in the original LongList.
remove from the MutableLongList
Removes all elements from the MutableLongList.
add to the MutableLongList.
Adds all elements to the end of the MutableLongList.
Removes element from the MutableLongList. If element was in the MutableLongList and was removed, true will be returned, or false will be returned if the element was not found.
Returns true if all elements match the given predicate while iterating in the reverse order.
Returns true if any of the elements give a true return value for predicate while iterating in the reverse order.
Sorts the MutableLongList elements in ascending order.
Sorts the MutableLongList elements in descending order.
Returns a new list of all elements sorted according to descending natural sort order.
Returns a LongArray containing all elements from this list in the same order.
Return a MutableSet of all elements. The returned set does NOT guarantee the element iteration order of the list.
Reduces the internal storage. If capacity is greater than minCapacity and size, the internal storage is reduced to the maximum of size and minCapacity.
Returns a WindowedLongList with the given windowSize sliding by step. Each window is a view into the original list.