Double List
DoubleList is a List-like collection for Double values. It allows retrieving the elements without boxing. DoubleList is always backed by a MutableDoubleList, its MutableList-like subclass. The purpose of this class is to avoid the performance overhead of auto-boxing due to generics since Collection classes all operate on objects.
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.
Inheritors
Properties
Returns an IntRange of the valid indices for this DoubleList.
Returns the last valid index in the DoubleList. This can be -1 when the list is empty.
The number of elements in the DoubleList.
Functions
Splits this list into chunks of specified size.
Splits this list into a list of InPlaceDoubleSubList each not exceeding the given chunkSize. The last list may have less elements than the given chunkSize.
Returns true if the DoubleList contains all elements in elements or false if one or more are missing.
Returns a new list that is a copy of the current list.
Returns a new list containing only distinct elements from the current list.
Returns a new list containing all elements except first n elements.
Returns a new list containing all elements except last n elements.
Returns a new DoubleList containing all elements except the last elements that satisfy the given predicate.
Returns the element at the given index or defaultValue if index is out of bounds of the collection.
Returns the first element in the DoubleList or throws a NoSuchElementException if it isEmpty.
Returns the first element in the DoubleList for which predicate returns true or throws NoSuchElementException if nothing matches.
Calls block for each element in the DoubleList along with its index, in order.
Calls block for each element in the DoubleList in reverse order.
Calls block for each element in the DoubleList along with its index, in reverse order.
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 a hash code based on the contents of the DoubleList.
Returns the index if the first element in the DoubleList for which predicate returns true.
Returns the index if the last element in the DoubleList for which predicate returns true.
Returns true if the DoubleList has no elements in it or false otherwise.
Returns true if there are elements in the DoubleList 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 the last element in the DoubleList or throws a NoSuchElementException if it isEmpty.
Returns the last element in the DoubleList for which predicate returns true or throws NoSuchElementException if nothing matches.
Returns the index of the last element in the DoubleList that is the same as element or -1 if no elements match.
Returns an List
Returns a DoubleList containing the results of applying the given transform function to each element in the original DoubleList.
Returns a FloatList containing the results of applying the given transform function to each element in the original DoubleList.
Returns a IntList containing the results of applying the given transform function to each element in the original DoubleList.
Returns a LongList containing the results of applying the given transform function to each element in the original DoubleList.
Returns a List containing the results of applying the given transform function to each element and its index in the original DoubleList.
Returns a DoubleList containing the results of applying the given transform function to each element and its index in the original DoubleList.
Returns a FloatList containing the results of applying the given transform function to each element and its index in the original DoubleList.
Returns a IntList containing the results of applying the given transform function to each element and its index in the original DoubleList.
Returns a LongList containing the results of applying the given transform function to each element and its index in the original DoubleList.
Returns the DoubleList itself if it's not null; otherwise returns an empty DoubleList.
Returns a new list with all elements in reversed order.
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.
Returns a new list of all elements sorted according to natural sort order.
Returns a new list of all elements sorted according to descending natural sort order.
Returns a new list containing the first n elements of this list.
Returns a new list containing the last n elements of this list.
Returns a new DoubleList containing the last elements that satisfy the given predicate.
Returns a new DoubleList containing the first elements that satisfy the given predicate.
Returns a DoubleArray 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.
Returns a WindowedDoubleList with the given windowSize sliding by step. Each window is a view into the original list.