Package | Description |
---|---|
io.vavr.collection |
Purely functional collections based on Traversable.
|
Modifier and Type | Interface and Description |
---|---|
interface |
BitSet<T>
An immutable
BitSet implementation. |
interface |
IndexedSeq<T>
Interface for immutable, indexed sequences.
|
interface |
Iterator<T>
io.vavr.collection.Iterator is a compositional replacement for java.util.Iterator
whose purpose is to iterate once over a sequence of elements. |
interface |
LinearSeq<T>
Interface for immutable, linear sequences.
|
interface |
List<T>
An immutable
List is an eager sequence of elements. |
interface |
Map<K,V>
An immutable
Map interface. |
interface |
Multimap<K,V>
An immutable
Multimap interface. |
interface |
Seq<T>
Interface for immutable sequential data structures.
|
interface |
Set<T>
An immutable
Set interface. |
interface |
SortedMap<K,V>
An immutable
SortedMap interface. |
interface |
SortedMultimap<K,V>
An immutable
SortedMultimap interface. |
interface |
SortedSet<T>
An immutable
SortedSet interface. |
interface |
Stream<T>
An immutable
Stream is lazy sequence of elements which may be infinitely long. |
interface |
Tree<T>
A general Tree interface.
|
Modifier and Type | Class and Description |
---|---|
class |
Array<T>
Array is a Traversable wrapper for
Object[] containing elements of type T . |
class |
CharSeq
The CharSeq (read: character sequence) collection essentially is a rich String wrapper having all operations
we know from the functional Vavr collections.
|
class |
HashMap<K,V>
An immutable
HashMap implementation based on a
Hash array mapped trie (HAMT). |
class |
HashMultimap<K,V>
|
class |
HashSet<T>
An immutable
HashSet implementation. |
class |
LinkedHashMap<K,V>
An immutable
LinkedHashMap implementation that has predictable (insertion-order) iteration. |
class |
LinkedHashMultimap<K,V>
A
LinkedHashMap -based implementation of Multimap |
class |
LinkedHashSet<T>
An immutable
HashSet implementation that has predictable (insertion-order) iteration. |
static class |
List.Cons<T>
Non-empty
List , consisting of a head and a tail . |
static class |
List.Nil<T>
Representation of the singleton empty
List . |
class |
PriorityQueue<T>
A PriorityQueue.
|
class |
Queue<T>
An immutable
Queue stores elements allowing a first-in-first-out (FIFO) retrieval. |
static class |
Stream.Cons<T>
Non-empty
Stream , consisting of a head , and tail . |
static class |
Stream.Empty<T>
The empty Stream.
|
static class |
Tree.Empty<T>
The empty tree.
|
static class |
Tree.Node<T>
Represents a tree node.
|
class |
TreeMap<K,V>
SortedMap implementation, backed by a Red/Black Tree.
|
class |
TreeMultimap<K,V>
|
class |
TreeSet<T>
SortedSet implementation, backed by a Red/Black Tree.
|
class |
Vector<T>
Vector is the default Seq implementation that provides effectively constant time access to any element.
|
Modifier and Type | Method and Description |
---|---|
default Traversable<V> |
Multimap.apply(K key)
Deprecated.
|
<R> Traversable<R> |
Traversable.collect(PartialFunction<? super T,? extends R> partialFunction)
Collects all elements that are in the domain of the given
partialFunction by mapping the elements to type R . |
Traversable<T> |
Traversable.distinct()
Returns a new version of this which contains no duplicates.
|
Traversable<T> |
Traversable.distinctBy(Comparator<? super T> comparator)
Returns a new version of this which contains no duplicates.
|
<U> Traversable<T> |
Traversable.distinctBy(Function<? super T,? extends U> keyExtractor)
Returns a new version of this which contains no duplicates.
|
Traversable<T> |
Traversable.drop(int n)
Drops the first n elements of this or all elements, if this length < n.
|
Traversable<T> |
Traversable.dropRight(int n)
Drops the last n elements of this or all elements, if this length < n.
|
Traversable<T> |
Traversable.dropUntil(Predicate<? super T> predicate)
Drops elements until the predicate holds for the current element.
|
Traversable<T> |
Traversable.dropWhile(Predicate<? super T> predicate)
Drops elements while the predicate holds for the current element.
|
Traversable<T> |
Traversable.filter(Predicate<? super T> predicate)
Returns a new traversable consisting of all elements which satisfy the given predicate.
|
<U> Traversable<U> |
Traversable.flatMap(Function<? super T,? extends Iterable<? extends U>> mapper)
FlatMaps this Traversable.
|
Traversable<V> |
Multimap.getOrElse(K key,
Traversable<? extends V> defaultValue)
Returns the value associated with a key, or a default value if the key is not contained in the map
|
Traversable<T> |
Traversable.init()
Dual of tail(), returning all elements except the last.
|
<U> Traversable<U> |
Traversable.map(Function<? super T,? extends U> mapper)
Maps the elements of this
Traversable to elements of a new type preserving their order, if any. |
static <T> Traversable<T> |
Traversable.narrow(Traversable<? extends T> traversable)
Narrows a widened
Traversable<? extends T> to Traversable<T>
by performing a type-safe cast. |
Traversable<T> |
Traversable.orElse(Iterable<? extends T> other)
Returns this
Traversable if it is nonempty, otherwise return the alternative. |
Traversable<T> |
Traversable.orElse(Supplier<? extends Iterable<? extends T>> supplier)
Returns this
Traversable if it is nonempty, otherwise return the result of evaluating supplier. |
Traversable<T> |
Traversable.peek(Consumer<? super T> action) |
default Traversable<T> |
Traversable.reject(Predicate<? super T> predicate)
Returns a new traversable consisting of all elements which do not satisfy the given predicate.
|
Traversable<T> |
Traversable.replace(T currentElement,
T newElement)
Replaces the first occurrence (if exists) of the given currentElement with newElement.
|
Traversable<T> |
Traversable.replaceAll(T currentElement,
T newElement)
Replaces all occurrences of the given currentElement with newElement.
|
Traversable<T> |
Traversable.retainAll(Iterable<? extends T> elements)
Keeps all occurrences of the given elements from this.
|
default Traversable<T> |
Iterator.scan(T zero,
BiFunction<? super T,? super T,? extends T> operation) |
Traversable<T> |
Traversable.scan(T zero,
BiFunction<? super T,? super T,? extends T> operation)
Computes a prefix scan of the elements of the collection.
|
<U> Traversable<U> |
Traversable.scanLeft(U zero,
BiFunction<? super U,? super T,? extends U> operation)
Produces a collection containing cumulative results of applying the
operator going left to right.
|
<U> Traversable<U> |
Traversable.scanRight(U zero,
BiFunction<? super T,? super U,? extends U> operation)
Produces a collection containing cumulative results of applying the
operator going right to left.
|
Traversable<T> |
Traversable.tail()
Drops the first element of a non-empty Traversable.
|
Traversable<T> |
Traversable.take(int n)
Takes the first n elements of this or all elements, if this length < n.
|
Traversable<T> |
Traversable.takeRight(int n)
Takes the last n elements of this or all elements, if this length < n.
|
Traversable<T> |
Traversable.takeUntil(Predicate<? super T> predicate)
Takes elements until the predicate holds for the current element.
|
Traversable<T> |
Traversable.takeWhile(Predicate<? super T> predicate)
Takes elements while the predicate holds for the current element.
|
Traversable<V> |
Multimap.values() |
<U> Traversable<Tuple2<T,U>> |
Traversable.zip(Iterable<? extends U> that)
Returns a traversable formed from this traversable and another Iterable collection by combining
corresponding elements in pairs.
|
<U> Traversable<Tuple2<T,U>> |
Traversable.zipAll(Iterable<? extends U> that,
T thisElem,
U thatElem)
Returns a traversable formed from this traversable and another Iterable by combining corresponding elements in
pairs.
|
<U,R> Traversable<R> |
Traversable.zipWith(Iterable<? extends U> that,
BiFunction<? super T,? super U,? extends R> mapper)
Returns a traversable formed from this traversable and another Iterable collection by mapping elements.
|
Traversable<Tuple2<T,Integer>> |
Traversable.zipWithIndex()
Zips this traversable with its indices.
|
<U> Traversable<U> |
Traversable.zipWithIndex(BiFunction<? super T,? super Integer,? extends U> mapper)
Returns a traversable formed from this traversable and another Iterable collection by mapping elements.
|
Modifier and Type | Method and Description |
---|---|
Map<K,Traversable<V>> |
Multimap.asMap()
Converts this
Multimap to a Map |
default PartialFunction<K,Traversable<V>> |
Multimap.asPartialFunction()
Turns this
Multimap into a PartialFunction which is defined at a specific index, if this Multimap
contains the given key. |
Option<Traversable<V>> |
Multimap.get(K key)
Returns the
Some of value to which the specified key
is mapped, or None if this multimap contains no mapping for the key. |
<C> Map<C,? extends Traversable<T>> |
Traversable.groupBy(Function<? super T,? extends C> classifier)
Groups this elements by classifying the elements.
|
Iterator<? extends Traversable<T>> |
Traversable.grouped(int size)
Groups this
Traversable into fixed size blocks. |
default Option<? extends Traversable<T>> |
Traversable.initOption()
Dual of tailOption(), returning all elements except the last as
Option . |
Tuple2<? extends Traversable<T>,? extends Traversable<T>> |
Traversable.partition(Predicate<? super T> predicate)
Creates a partition of this
Traversable by splitting this elements in two in distinct traversables
according to a predicate. |
Tuple2<? extends Traversable<T>,? extends Traversable<T>> |
Traversable.partition(Predicate<? super T> predicate)
Creates a partition of this
Traversable by splitting this elements in two in distinct traversables
according to a predicate. |
Iterator<? extends Traversable<T>> |
Traversable.slideBy(Function<? super T,?> classifier)
Slides a non-overlapping window of a variable size over this
Traversable . |
Iterator<? extends Traversable<T>> |
Traversable.sliding(int size)
Slides a window of a specific
size and step size 1 over this Traversable by calling
sliding(int, int) . |
Iterator<? extends Traversable<T>> |
Traversable.sliding(int size,
int step)
Slides a window of a specific
size and step size over this Traversable . |
Tuple2<? extends Traversable<T>,? extends Traversable<T>> |
Traversable.span(Predicate<? super T> predicate)
Returns a tuple where the first element is the longest prefix of elements that satisfy the given
predicate and the second element is the remainder. |
Tuple2<? extends Traversable<T>,? extends Traversable<T>> |
Traversable.span(Predicate<? super T> predicate)
Returns a tuple where the first element is the longest prefix of elements that satisfy the given
predicate and the second element is the remainder. |
Option<? extends Traversable<T>> |
Traversable.tailOption()
Drops the first element of a non-empty Traversable and returns an
Option . |
<T1,T2> Tuple2<? extends Traversable<T1>,? extends Traversable<T2>> |
Traversable.unzip(Function<? super T,Tuple2<? extends T1,? extends T2>> unzipper)
Unzips this elements by mapping this elements to pairs which are subsequently split into two distinct
sets.
|
<T1,T2> Tuple2<? extends Traversable<T1>,? extends Traversable<T2>> |
Traversable.unzip(Function<? super T,Tuple2<? extends T1,? extends T2>> unzipper)
Unzips this elements by mapping this elements to pairs which are subsequently split into two distinct
sets.
|
<T1,T2,T3> Tuple3<? extends Traversable<T1>,? extends Traversable<T2>,? extends Traversable<T3>> |
Traversable.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper)
Unzips this elements by mapping this elements to triples which are subsequently split into three distinct
sets.
|
<T1,T2,T3> Tuple3<? extends Traversable<T1>,? extends Traversable<T2>,? extends Traversable<T3>> |
Traversable.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper)
Unzips this elements by mapping this elements to triples which are subsequently split into three distinct
sets.
|
<T1,T2,T3> Tuple3<? extends Traversable<T1>,? extends Traversable<T2>,? extends Traversable<T3>> |
Traversable.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper)
Unzips this elements by mapping this elements to triples which are subsequently split into three distinct
sets.
|
Modifier and Type | Method and Description |
---|---|
Traversable<V> |
Multimap.getOrElse(K key,
Traversable<? extends V> defaultValue)
Returns the value associated with a key, or a default value if the key is not contained in the map
|
static <T> Traversable<T> |
Traversable.narrow(Traversable<? extends T> traversable)
Narrows a widened
Traversable<? extends T> to Traversable<T>
by performing a type-safe cast. |
Modifier and Type | Method and Description |
---|---|
protected <K2,V2> HashMultimap<K2,V2> |
HashMultimap.createFromMap(Map<K2,Traversable<V2>> back) |
protected <K2,V2> TreeMultimap<K2,V2> |
TreeMultimap.createFromMap(Map<K2,Traversable<V2>> back) |
protected <K2,V2> LinkedHashMultimap<K2,V2> |
LinkedHashMultimap.createFromMap(Map<K2,Traversable<V2>> back) |
<K2 extends K,V2 extends V> |
SortedMultimap.merge(Multimap<K2,V2> that,
BiFunction<Traversable<V>,Traversable<V2>,Traversable<V>> collisionResolution) |
<K2 extends K,V2 extends V> |
SortedMultimap.merge(Multimap<K2,V2> that,
BiFunction<Traversable<V>,Traversable<V2>,Traversable<V>> collisionResolution) |
<K2 extends K,V2 extends V> |
SortedMultimap.merge(Multimap<K2,V2> that,
BiFunction<Traversable<V>,Traversable<V2>,Traversable<V>> collisionResolution) |
<K2 extends K,V2 extends V> |
Multimap.merge(Multimap<K2,V2> that,
BiFunction<Traversable<V>,Traversable<V2>,Traversable<V>> collisionResolution)
Creates a new multimap which by merging the entries of
this multimap and that multimap. |
<K2 extends K,V2 extends V> |
Multimap.merge(Multimap<K2,V2> that,
BiFunction<Traversable<V>,Traversable<V2>,Traversable<V>> collisionResolution)
Creates a new multimap which by merging the entries of
this multimap and that multimap. |
<K2 extends K,V2 extends V> |
Multimap.merge(Multimap<K2,V2> that,
BiFunction<Traversable<V>,Traversable<V2>,Traversable<V>> collisionResolution)
Creates a new multimap which by merging the entries of
this multimap and that multimap. |
Copyright © 2020. All Rights Reserved.