Additional top-level class in compilation unit: TraversableModule.
Iterable#iterator(), which may vary each time it is called.
Basic operations:
collect(PartialFunction)contains(Object)containsAll(Iterable)head()headOption()init()initOption()isEmpty()last()lastOption()length()size()tail()tailOption()forEachWithIndex(ObjIntConsumer)grouped(int)iterator()slideBy(Function)sliding(int)sliding(int, int)average()max()maxBy(Comparator)maxBy(Function)min()minBy(Comparator)minBy(Function)product()sum()count(Predicate)fold(Object, BiFunction)foldLeft(Object, BiFunction)foldRight(Object, BiFunction)mkString()mkString(CharSequence)mkString(CharSequence, CharSequence, CharSequence)reduce(BiFunction)reduceOption(BiFunction)reduceLeft(BiFunction)reduceLeftOption(BiFunction)reduceRight(BiFunction)reduceRightOption(BiFunction)drop(int)dropRight(int)dropUntil(Predicate)dropWhile(Predicate)filter(Predicate)reject(Predicate)find(Predicate)findLast(Predicate)groupBy(Function)partition(Predicate)retainAll(Iterable)take(int)takeRight(int)takeUntil(Predicate)takeWhile(Predicate)existsUnique(Predicate)hasDefiniteSize()isDistinct()isOrdered()isSequential()isTraversableAgain()distinct()distinctBy(Comparator)distinctBy(Function)flatMap(Function)map(Function)replace(Object, Object)replaceAll(Object, Object)scan(Object, BiFunction)scanLeft(Object, BiFunction)scanRight(Object, BiFunction)span(Predicate)unzip(Function)unzip3(Function)zip(Iterable)zipAll(Iterable, Object, Object)zipWithIndex()| Modifier and Type | Method and Description |
|---|---|
| public default < key class type K> Option | |
| public default Option | |
| public < The new element type R> Traversable | Returns: A newTraversable instance containing elements of type RA function that is not necessarily defined of all elements of this traversable. partialFunction)Collects all elements that are in the domain of the given |
| public default boolean | Returns: true, if this List contains all given elements, false otherwise.A List of values of type T. elements)Tests if this Traversable contains all given elements. |
| public default int | |
| public Traversable | Returns: a newTraversable containing this elements without duplicatesReturns a new version of this which contains no duplicates. |
| public Traversable | Returns: a newTraversable containing this elements without duplicatesA comparator comparator)Returns a new version of this which contains no duplicates. |
| public < key type U> Traversable | Returns: a newTraversable containing this elements without duplicatesA key extractor keyExtractor)Returns a new version of this which contains no duplicates. |
| public Traversable | Returns: a new instance consisting of all elements of this except the first n ones, or else the empty instance, if this has less than n elements.The number of elements to drop. n)Drops the first n elements of this or all elements, if this length < n. |
| public Traversable | Returns: a new instance consisting of all elements of this except the last n ones, or else the empty instance, if this has less than n elements.The number of elements to drop. n)Drops the last n elements of this or all elements, if this length < n. |
| public Traversable | |
| public Traversable | |
| public boolean | Returns: true, if this collection equals the given object according to the rules described above, false otherwise.an object, may be null obj)Redeclares io. In Vavr there are four basic classes of collections:
|
| public default boolean | Returns: true, if predicate holds for a unique element, false otherwiseA Predicate predicate)Checks, if a unique elements exists such that the predicate holds. |
| public Traversable | |
| public default Option | |
| public default Option | |
| public < The resulting component type. U> Traversable | |
| public default <U> U | foldLeft(U
A zero element to start with. zero, BiFunction<? super U, ? super T, ? extends U> A function which combines elements. f)Implements io. Folds this elements from the left, starting with |
| public <U> U | foldRight(U
A zero element to start with. zero, BiFunction<? super T, ? super U, ? extends U> A function which combines elements. f)Redeclares io. Folds this elements from the right, starting with |
| public default void | |
| public default T | Returns: the first valueImplements io. Gets the first value in iteration order if this |
| public < classified class type C> Map | |
| public Iterator | Returns: A new Iterator of grouped blocks of the given sizea positive block size size)Groups this |
| public boolean | Returns: true, if this Traversable is known to have a finite size, false otherwise.Checks if this Traversable is known to have a finite size. |
| public int | Returns: The hash code of this collectionRedeclares io. Returns the hash code of this collection. |
| public T | Returns: The first element of this Traversable.Returns the first element of a non-empty Traversable. |
| public default Option | Returns: Some(element) or None if this is empty.Returns the first element of a non-empty Traversable as |
| public Traversable | |
| public default Option | Returns: Some(traversable) or None if this is empty.Dual of tailOption(), returning all elements except the last as |
| public default boolean | Returns: true if this Traversable may consist of distinct elements only, false otherwise.Checks if this Traversable may consist of distinct elements only. |
| public default boolean | Returns: true, if this Traversable contains no elements, false otherwise.Implements io. Checks if this Traversable is empty. |
| public default boolean | Returns: true, if this Traversable is ordered, false otherwise.Checks if this Traversable is ordered |
| public default boolean | Returns: true, if the insertion order of elements is preserved, false otherwise.Checks if the elements of this Traversable appear in encounter order. |
| public default boolean | Returns: falseImplements io. Each of Vavr's collections may contain more than one element. |
| public boolean | Returns: true, if this Traversable is known to be traversable repeatedly, false otherwise.Checks if this Traversable can be repeatedly traversed. |
| public default Iterator | Returns: A new Iterator of this Traversable elements.Implements io. An iterator by means of head() and tail(). |
| public T | |
| public default Option | Returns: Some(element) or None if this is empty.Dual of headOption(), returning the last element as |
| public int | |
| public < Component type of the target Traversable U> Traversable | Returns: a mapped TraversableA mapper. mapper)Redeclares io. Maps the elements of this |
| public default Option | Returns: Some(maximum) of this elements or None if this is emptyCalculates the maximum of this elements according to their natural order. |
| public default Option | Returns: Some(maximum) of this elements or None if this is emptyA non-null element comparator comparator)Calculates the maximum of this elements using a specific comparator. |
| public default < The type where elements are compared U extends Comparable | |
| public default Option | Returns: Some(minimum) of this elements or None if this is emptyCalculates the minimum of this elements according to their natural order in O(n). |
| public default Option | Returns: Some(minimum) of this elements or None if this is emptyA non-null element comparator comparator)Calculates the minimum of this elements using a specific comparator. |
| public default < The type where elements are compared U extends Comparable | |
| public default CharSeq | |
| public default CharSeq | Returns: A newCharSeqA delimiter string put between string representations of elements of this delimiter)Joins the string representations of this elements using a specific delimiter. |
| public default CharSeq | Returns: a newCharSeqprefix of the resulting prefix, CharSequence CharSeqA delimiter string put between string representations of elements of this delimiter, CharSequence suffix of the resulting suffix)CharSeqJoins the string representations of this elements using a specific delimiter, prefix and suffix. |
| public default String | Returns: a new StringJoins the elements of this by concatenating their string representations. |
| public default String | Returns: A new StringA delimiter string put between string representations of elements of this delimiter)Joins the string representations of this elements using a specific delimiter. |
| public default String | Returns: a new Stringprefix of the resulting string prefix, CharSequence A delimiter string put between string representations of elements of this delimiter, CharSequence suffix of the resulting string suffix)Joins the string representations of this elements using a specific delimiter, prefix and suffix. |
| public static < Component type of the T> TraversableTraversable. | Returns: the giventraversable instance as narrowed type Traversable<T>.An traversable)Traversable.Narrows a widened |
| public default boolean | Returns: true, if an underlying value is present, false otherwise.Checks, this |
| public Traversable | |
| public Traversable | |
| public Tuple2 | Returns: A disjoint union of two traversables. The firstTraversable contains all elements that satisfy the given predicate, the second Traversable contains all elements that don't. The original order of elements is preserved.A predicate which classifies an element if it is in the first or the second traversable. predicate)Creates a partition of this |
| public Traversable | peek(Consumer<? super T>
The action that will be performed on the element(s). action)Redeclares io. Performs the given |
| public default Number | Returns: aNumber representing the sum of this elementsCalculates the product of this elements. |
| public default T | Returns: the reduced value.A BiFunction of type T op)Implements io. Accumulates the elements of this Traversable by successively calling the given operation |
| public default Option | Returns: a reduced valueA BiFunction of type T op)Implements io. Shortcut for |
| public default T | Returns: the reduced value.An operation of type T op)Implements io. Accumulates the elements of this Traversable by successively calling the given operation |
| public default Option | Returns: a reduced valueAn operation of type T op)Implements io. Shortcut for |
| public default Traversable | |
| public Traversable | Returns: a Traversable containing all elements of this where the first occurrence of currentElement is replaced with newElement.An element to be substituted. currentElement, T A replacement for currentElement. newElement)Replaces the first occurrence (if exists) of the given currentElement with newElement. |
| public Traversable | Returns: a Traversable containing all elements of this where all occurrences of currentElement are replaced with newElement.An element to be substituted. currentElement, T A replacement for currentElement. newElement)Replaces all occurrences of the given currentElement with newElement. |
| public Traversable | |
| public Traversable | Returns: a new traversable collection containing the prefix scan of the elements in this traversable collectionneutral element for the operator op zero, BiFunction<? super T, ? super T, ? extends T> the associative operator for the scan operation)Computes a prefix scan of the elements of the collection. |
| public < the type of the elements in the resulting collection U> Traversable | Returns: collection with intermediate resultsthe initial value zero, BiFunction<? super U, ? super T, ? extends U> the binary operator applied to the intermediate result and the element operation)Produces a collection containing cumulative results of applying the operator going left to right. |
| public < the type of the elements in the resulting collection U> Traversable | Returns: collection with intermediate resultsthe initial value zero, BiFunction<? super T, ? super U, ? extends U> the binary operator applied to the intermediate result and the element operation)Produces a collection containing cumulative results of applying the operator going right to left. |
| public default T | Returns: the single element from the TraversableReturns the single element of this Traversable or throws, if this is empty or contains more than one element. |
| public default Option | Returns: Some(element) or None if the Traversable does not contain a single element.Returns the only element of a Traversable as |
| public default int | |
| public Iterator | |
| public Iterator | Returns: a new Iterator of windows of a specific size using step size 1a positive window size size)Slides a window of a specific |
| public Iterator | Returns: a new Iterator of windows of a specific size using a specific step sizea positive window size size, int a positive step size step)Slides a window of a specific |
| public Tuple2 | |
| public default Spliterator | spliterator()
Overrides default io. Creates a |
| public default Number | |
| public Traversable | Returns: A new instance of Traversable containing all elements except the first.Drops the first element of a non-empty Traversable. |
| public Option | Returns: Some(traversable) or None if this is empty.Drops the first element of a non-empty Traversable and returns an |
| public Traversable | Returns: A new instance consisting of the first n elements of this or all elements, if this has less than n elements.The number of elements to take. n)Takes the first n elements of this or all elements, if this length < n. |
| public Traversable | Returns: A new instance consisting of the last n elements of this or all elements, if this has less than n elements.The number of elements to take. n)Takes the last n elements of this or all elements, if this length < n. |
| public Traversable | |
| public Traversable | |
| public < 1st element type of a pair returned by unzipper T1, 2nd element type of a pair returned by unzipper T2> Tuple2 | |
| public < 1st element type of a triplet returned by unzipper T1, 2nd element type of a triplet returned by unzipper T2, 3rd element type of a triplet returned by unzipper T3> Tuple3 | Returns: A triplet of set containing elements split by unzippera function which converts elements of this to pairs unzipper)Unzips this elements by mapping this elements to triples which are subsequently split into three distinct sets. |
| public < The type of the second half of the returned pairs. U> Traversable | Returns: a new traversable containing pairs consisting of corresponding elements of this traversable andthat iterable.The Iterable providing the second half of each result pair. that)Returns a traversable formed from this traversable and another Iterable collection by combining corresponding elements in pairs. |
| public < The type of the second half of the returned pairs. U> Traversable | Returns: A new traversable containing pairs consisting of corresponding elements of this traversable and that.The Iterable providing the second half of each result pair. that, T The element to be used to fill up the result if this traversable is shorter than that. thisElem, U The element to be used to fill up the result if that is shorter than this traversable. thatElem)Returns a traversable formed from this traversable and another Iterable by combining corresponding elements in pairs. |
| public < The type of the second parameter of the mapper. U, The type of the mapped elements. R> Traversable | Returns: a new traversable containing mapped elements of this traversable andthat iterable.The Iterable providing the second parameter of the mapper. that, BiFunction<? super T, ? super U, ? extends R> a mapper. mapper)Returns a traversable formed from this traversable and another Iterable collection by mapping elements. |
| public Traversable | Returns: A new traversable containing all elements of this traversable paired with their index, starting with 0.Zips this traversable with its indices. |
| public < The type of the mapped elements. U> Traversable | Returns: a new traversable containing elements of this traversable, zipped with indices, and mapped with mapper provided.a mapper. mapper)Zips this traversable with its indices by applying mapper provided. |