![]() Returns whether any entry in this collection passes a given test. Returns an array of entries where every value from the collection is placed into the same equivalence class if they return the same key through the given callback. reduceRight(callback, basis)Īggregates every value in this collection, from right to left. reduce(callback, basis)Īggregates every value in this collection with the result collected up to that index. Returns an array with each value from this collection that passes the given test. Returns an array of the respective return values of a callback for each entry in this collection. forEach(callback, thisp?)Ĭalls the callback for each entry in the collection. findLastValue(value, equals?, start?)įinds the last equivalent value, searching from the right. findLast(value, equals?, start?)įinds the last equivalent value, searching from the right. findValue(value, equals?, start?)įinds the first equivalent value. find(value, equals?, start?)įinds the first equivalent value. clear()ĭeletes all of the values in the collection. Replaces a length of values from a starting position with the given values. Replaces a length of values from a starting position with the given variadic values, and returns the values that were replaced as an array. Returns an array of the values contained in the half-open interval [start, end), that is, including the start and excluding the end. ![]() deleteAll(value, equals?)ĭeletes every value equivalent to the given value from the collection. Returns the number of successful deletions. deleteEach(values|keys, equals?)ĭeletes every value or every value for each key. addEach(values|map)Ĭopies values or entries from another collection into this collection, and then returns this. Returns whether the value was found and successfully deleted. Seeks out and deletes an equivalent value. Returns whether the key was found and successfully deleted. delete(value)ĭeletes the first equivalent value. Retrieves the equivalent value from this collection. Retrieves the equivalent value from the collection. Returns whether an equivalent value exists in this collection. Whether an equivalent value exists in this collection. Replaces the value at the beginning of a collection, the value that would be returned by shift(). Returns the value at the beginning of a collection, the value that would be returned by shift(). unshift(.values)Īdds values to the beginning of a collection. Removes a value from the beginning of a collection, and returns that value. Removes a value from the end of a collection, and returns that value. Methods push(.values)Īdds values to the end of a collection. Which obviates the principle advantage of using the linked list structure.Īlso, direct manipulation of the nodes is not observable and will require manual List, it must scan back to the head of the list to determine the node’s index, Making range changes observable on a list requires that for each change to the Lists provide range change listeners, but at significant cost. These methods will always accept a node instead to instantly traverse to a known Methods that accept indexes to seek a position will count as they walk to the Lists provide slow random access by index. The iterator will produce artificial indexes for each value. ![]() However, if you do not need to splice, a Deque may perform better than List. ![]() Nodes can be reused to avoid garbage collector churn. It supports delete(), addBefore(node), and addAfter(node).ĭirectly manipulating next and prev of a node allows for fast splicing. Lists use a Node(value) property as their node constructor. The head represents the node one past the end of the list and has no value. The last node of the list is the prev node from the head. The list begins with the next node from the head. The list has a head property to an empty node. A List is backed by a doubly linked list with a head node.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |