From fe588b854d662f96c2d3ea3f438abfd0eb31cd5a Mon Sep 17 00:00:00 2001
From: Aplet123 tee
the iterator into two first if you want to preserve elements.
Instantiates an IterPlus
from any iterator.
The iterator to wrap around.
-The internal iterator that this wraps around.
-Makes the iterator work as an iterable.
The same iterator.
-Checks if every element in this iterator is equal.
This function is short-circuiting, so it stops on the first inequality.
If every element is equal, or true if the iterator has one or less elements.
-Checks if every element in this iterator is equal, using a comparison function.
This function is short-circuiting, so it stops on the first inequality.
A function that checks if elements are equal.
If every element is equal, or true if the iterator has one or less elements.
-Checks if every element in this iterator is equal, using a key function.
This function is short-circuiting, so it stops on the first inequality.
@@ -34,11 +34,11 @@The key function.
If every element is equal, or true if the iterator has one or less elements.
-Returns the average of all elements in the iterator.
The average.
-Returns an iterator yielding non-overlapping chunks of the iterator.
If there aren't enough elements to fill a chunk, the last chunk will be smaller than the chunk size.
@@ -47,7 +47,7 @@The chunk size.
An iterator that yields the chunks.
-Returns an iterator yielding non-overlapping chunks of the iterator.
If there aren't enough elements to fill a chunk, the extra elements will be omitted.
@@ -56,22 +56,22 @@The chunk size.
An iterator that yields the chunks.
-Collects the items in this iterator into an array.
An array with the items in the iterator.
-Calls a specified collector function with this iterator as its only argument.
The collector to use.
The return value of the collector.
-Lexicographically compares this iterator with another.
This function is short-circuiting, so it stops on the first inequality.
Iterable to compare to.
-1 if this is less than the other, 0 if it's equal, and 1 if it's greater than.
-Lexicographically compares this iterator with another using a comparison function.
This function is short-circuiting, so it stops on the first inequality.
@@ -83,7 +83,7 @@A function that should return a negative for less than, zero for equal to, and positive for greater than.
-1 if this is less than the other, 0 if it's equal, and 1 if it's greater than.
-Lexicographically compares this iterator with another using a key.
This function is short-circuiting, so it stops on the first inequality.
@@ -94,58 +94,58 @@Function to generate a key to compare with from an element.
-1 if this is less than the other, 0 if it's equal, and 1 if it's greater than.
-Concatenates one or more iterables to this iterator, creating an iterator that yields their elements in sequentual order.
The iterables to chain to this one.
The generated iterator.
-Calls a specified constructor with this iterator as its only argument.
The constructor to use.
The constructed value.
-Counts the number of items in this iterator.
The number of items in the iterator.
-Counts the number of items in this iterator that match a predicate.
The predicate function.
The number of matched items in the iterator.
-Removes elements of an iterator that are equal to the previous one.
An iterator with no consecutive duplicates.
-Removes elements of an iterator that are equal to the previous one with a comparison function.
A function that checks if elements are equal.
An iterator with no consecutive duplicates.
-Removes elements of an iterator that are equal to the previous one with a key.
The type of the key.
The key function.
An iterator with no consecutive duplicates.
-Drops elements from the iterator from the end.
This uses memory proportional to the number of elements dropped, as the iterator must look ahead and store elements to know that it has not reached the end.
The number of elements to drop.
An iterator with the specified number of elements removed from the end.
-Generates an iterator that yields a 2 element array with the index and the element.
The generated iterator.
-Checks if this iterator is equal to another.
This function is short-circuiting, so it stops on the first inequality.
Iterable to compare to.
If the two iterators are equal.
-Checks if this iterator is equal to another using a comparison function.
This function is short-circuiting, so it stops on the first inequality.
@@ -156,7 +156,7 @@A function that checks if elements are equal.
If the two iterators are equal.
-Checks if this iterator is equal to another using a key.
This function is short-circuiting, so it stops on the first inequality.
@@ -167,7 +167,7 @@Function to generate a key to compare with from an element.
If the two iterators are equal.
-Checks if every element in the iterator matches a predicate.
This function is short-circuiting,
so if any element returns false
,
@@ -175,26 +175,26 @@
The predicate function.
If every element satisfies the predicate.
-Generates an iterator that only yields elements that match a predicate.
The predicate function.
The generated iterator.
-Generates a mapped iterator that yields non-null elements.
The resulting type.
The mapping function.
The generated iterator.
-Finds an element that satisfies a predicate.
This function is short-circuiting, so it stops on the first match.
The predicate function.
The element, or null if none was found.
-Finds the index of an element that satisfies a predicate.
If you want to find the value and the index, consider using enumerate
then using find
.
The predicate function.
The index, or -1 if none was found.
-Runs a function on every element and returns the first non-null element.
This function is short-circuiting, so it stops on the first match.
@@ -212,49 +212,49 @@The mapping function.
The element, or null if none was found.
-Maps then flattens an iterator.
The resulting type.
The mapping function.
The generated iterator.
-Flattens an iterator of iterables, yielding an iterator that sequentially produces their elements.
The internal type.
The generated iterator.
-Runs a function on each element of an iterator.
This is equivalent to running a for loop on the iterator.
If you want to obtain the values, consider using .map(func).collect()
instead.
The function to run.
-Generates an iterator that is guaranteed to never yield a value after finishing.
The generated iterator.
-Globs elements of an iterator together.
An iterator where every element is an array of consecutively equal elements.
-Globs elements of an iterator together, with a comparison function.
A function that checks if elements are equal.
An iterator where every element is an array of consecutively equal elements.
-Globs elements of an iterator together, with a key function.
The type of the key.
The key function.
An iterator where every element is an array of consecutively equal elements.
-Groups elements of an iterator together with a key function.
The type of the key.
An object mapping keys to arrays of matching items.
-Checks if this iterator is equal to another, while the second iterator still yields elements.
This function is short-circuiting, @@ -262,7 +262,7 @@
Iterable to compare to.
If the first iterator starts with the second iterator.
-Checks if this iterator is equal to another, while the second iterator still yields elements, using a comparison function.
This function is short-circuiting, @@ -274,7 +274,7 @@
A function that checks if elements are equal.
If the first iterator starts with the second iterator.
-Checks if this iterator is equal to another, while the second iterator still yields elements, with a key function.
This function is short-circuiting, @@ -286,7 +286,7 @@
The key function.
If the first iterator starts with the second iterator.
-Checks if this iterator is equal to another, while they both yield elements.
This function is short-circuiting, @@ -296,7 +296,7 @@
Iterable to compare to.
If the two iterators are equal.
-Checks if this iterator is equal to another, while they both yield elements, using a comparison function.
This function is short-circuiting, @@ -310,7 +310,7 @@
A function that checks if elements are equal.
If the two iterators are equal.
-Checks if this iterator is equal to another, while they both yield elements, using a key.
This function is short-circuiting, @@ -324,28 +324,28 @@
The key function.
If the two iterators are equal.
-Lazily runs functions on an iterator, returning a new iterator with unmodified elements.
This function is primarily used as a debugging tool to inspect elements in the middle of an iterator function chain.
The function to call.
The generated iterator.
-Interleaves one or more iterables with this iterator.
The iterables to interleave with this one.
The interleaved iterator, yielding elements in the iterators in order.
-Intersperses an element between every element of the iterator.
The element to intersperse.
The new iterator.
-Intersperses multiple elements between every element of the iterator.
The elements to intersperse.
The new iterator.
-Determines if an iterator is partitioned by a predicate (Items that return true come before items that return false).
This function is short-circuiting, @@ -353,12 +353,12 @@
The predicate function.
If the iterator is partitioned.
-Determines if an iterator is sorted increasingly.
This function is short-circuiting, so it stops on the first non-sorted element.
If the iterator is sorted.
-Determines if an iterator is sorted increasingly by a comparison function.
This function is short-circuiting, so it stops on the first non-sorted element.
@@ -366,7 +366,7 @@A function that should return a negative for less than, zero for equal to, and positive for greater than.
If the iterator is sorted.
-Determines if an iterator is sorted increasingly by a key.
This function is short-circuiting, so it stops on the first non-sorted element.
@@ -375,24 +375,24 @@The key function.
If the iterator is sorted.
-Joins an iterator of iterables with an element.
The internal type.
The element to join with.
The joined iterator.
-Joins an iterator of iterables with multiple elements.
The internal type.
The elements to intersperse.
The joined iterator.
-Finds the last element in an iterator.
The last element of the iterator, or null if the iterator is empty.
-Lazily maps an iterator, creating a new iterator where each element has been modified by a function.
If you want to immediately run a function on all elements of the iterator, use forEach
instead.
The mapping function.
The generated iterator.
-Runs a function for every element of the iterator, keeping track of an accumulator.
The type of the accumulator.
@@ -411,20 +411,20 @@The initial accumulator.
The mapped iterator.
-Lazily maps an iterator until it encounters null.
The resulting type.
The mapping function.
The generated iterator.
-Finds the maximum value of an iterator.
If true
, elements will be counted as the new maximum if they are equal to the maximum.
Defaults to false
.
The maximum element, or null if the iterator is empty.
-Finds the maximum value of an iterator with a comparison function.
A function that should return a negative for less than, zero for equal to, @@ -433,7 +433,7 @@
If true
, elements will be counted as the new maximum if they are equal to the maximum.
Defaults to false
.
The maximum element, or null if the iterator is empty.
-Finds the maximum value of an iterator with a key.
The type of the key.
@@ -443,13 +443,13 @@If true
, elements will be counted as the new maximum if they are equal to the maximum.
Defaults to false
.
The maximum element, or null if the iterator is empty.
-Finds the minimum value of an iterator.
If true
, elements will be counted as the new minimum if they are equal to the minimum.
Defaults to false
.
The minimum element, or null if the iterator is empty.
-Finds the minimum value of an iterator with a comparison function.
A function that should return a negative for less than, zero for equal to, @@ -458,7 +458,7 @@
If true
, elements will be counted as the new minimum if they are equal to the minimum.
Defaults to false
.
The minimum element, or null if the iterator is empty.
-
The item type of the iterator.
-