Multimap interface.
Basic operations:
containsKey(Object)containsValue(Object)get(Object)getContainerType()keySet()merge(Multimap)merge(Multimap, BiFunction)put(Object, Object)put(Tuple2)values()| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| public static final long |
| Modifier and Type | Method and Description |
|---|---|
| public default Traversable | apply(K
the argument key)Implements io.
Deprecated
Applies this function to the given argument and returns the result. |
| public Map | |
| public default PartialFunction | Returns: a newPartialFunctionTurns this |
| public < key's component type of the multimap result K2, value's component type of the multimap result V2> Multimap | Returns: a newMultimapa keyMapper, Function<? super V, ? extends V2> Function that maps the keys of type K to keys of type K2a valueMapper)Function that the values of type V to values of type V2Maps this |
| public default <R> Seq | collect(PartialFunction<? super Tuple2<K, V>, ? extends R>
A function that is not necessarily defined of all elements of this traversable. partialFunction)Implements io. Collects all elements that are in the domain of the given |
| public default boolean | contains(Tuple2<K, V>
An Object of type A, may be null. element)Overrides default io. Shortcut for |
| public boolean | Returns: true if this multimap contains a mapping for the specified keykey whose presence in this multimap is to be tested key)Returns |
| public default boolean | Returns: true if this multimap maps one or more keys to the
specified valuevalue whose presence in this multimap is to be tested value)Returns |
| public Multimap | distinct()
Redeclares io. Returns a new version of this which contains no duplicates. |
| public Multimap | distinctBy(Comparator<? super Tuple2<K, V>>
A comparator comparator)Redeclares io. Returns a new version of this which contains no duplicates. |
| public <U> Multimap | distinctBy(Function<? super Tuple2<K, V>, ? extends U>
A key extractor keyExtractor)Redeclares io. Returns a new version of this which contains no duplicates. |
| public Multimap | drop(int
The number of elements to drop. n)Redeclares io. Drops the first n elements of this or all elements, if this length < n. |
| public Multimap | dropRight(int
The number of elements to drop. n)Redeclares io. Drops the last n elements of this or all elements, if this length < n. |
| public Multimap | dropUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements. predicate)Redeclares io. Drops elements until the predicate holds for the current element. |
| public Multimap | dropWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements. predicate)Redeclares io. Drops elements while the predicate holds for the current element. |
| public Multimap | Returns: a new Multimapthe predicate used to test elements predicate)Returns a new Multimap consisting of all elements which satisfy the given predicate. |
| public Multimap | filter(Predicate<? super Tuple2<K, V>>
A predicate predicate)Redeclares io. Returns a new traversable consisting of all elements which satisfy the given predicate. |
| public Multimap | Returns: a new Multimapthe predicate used to test keys of elements predicate)Returns a new Multimap consisting of all elements with keys which satisfy the given predicate. |
| public Multimap | Returns: a new Multimapthe predicate used to test values of elements predicate)Returns a new Multimap consisting of all elements with values which satisfy the given predicate. |
| public < key's component type of the mapped K2, Multimapvalue's component type of the mapped V2> MultimapMultimap | Returns: A newMultimap.A mapper mapper)FlatMaps this |
| public default < Component type U> Seq | Returns: A sequence of flat-mapped values.A mapper mapper)Implements io. Flat-maps this entries to a sequence of values. |
| public default <U> U | foldRight(U
A zero element to start with. zero, BiFunction<? super Tuple2<K, V>, ? super U, ? extends U> A function which combines elements. f)Implements io. Folds this elements from the right, starting with |
| public default void | |
| public Option | Returns: theSome of value to which the specified key
is mapped, or None if this multimap contains no mapping
for the keythe key whose associated value is to be returned key)Returns the |
| public Multimap. | Returns: an enum value representing the container typeReturns the type of the |
| public Traversable | Returns: the value associated with key if it exists, otherwise the result of the default valuethe key key, Traversable<? extends V> a default value defaultValue)Returns the value associated with a key, or a default value if the key is not contained in the map |
| public <C> Map | groupBy(Function<? super Tuple2<K, V>, ? extends C>
A function which classifies elements into classes classifier)Redeclares io. Groups this elements by classifying the elements. |
| public Iterator | grouped(int
a positive block size size)Redeclares io. Groups this |
| public default boolean | hasDefiniteSize()
Implements io. Checks if this Traversable is known to have a finite size. |
| public Multimap | init()
Redeclares io. Dual of tail(), returning all elements except the last. |
| public Option | initOption()
Redeclares as abstract: io. Dual of tailOption(), returning all elements except the last as |
| public default boolean | isDefinedAt(K
a potential function argument key)Implements io.
Deprecated
Tests if a value is contained in the function's domain. |
| public default boolean | isDistinct()
Overrides default io. Checks if this Traversable may consist of distinct elements only. |
| public default boolean | isTraversableAgain()
Implements io. Checks if this Traversable can be repeatedly traversed. |
| public Iterator | iterator()
Redeclares as abstract: io. An iterator by means of head() and tail(). |
| public default < The type of the resulting elements U> Iterator | Returns: An iterator through the mapped elements.A function that maps (key, value) pairs to elements of type U mapper)Iterates this Multimap sequentially, mapping the (key, value) pairs to elements. |
| public Set | Returns: Set of the keys contained in this multimap.Returns the keys contained in this multimap. |
| public default int | length()
Implements io. Computes the number of elements of this Traversable. |
| public < key's component type of the multimap result K2, value's component type of the multimap result V2> Multimap | Returns: a newMultimapa mapper)Function that maps entries of type (K, V) to entries of type (K2, V2)Maps the entries of this |
| public default < Component type U> Seq | Returns: A sequence of mapped values.A mapper mapper)Implements io. Maps the |
| public < the new value type V2> Multimap | |
| public Multimap | |
| public < key type of that Multimap K2 extends K, value type of that Multimap V2 extends V> Multimap | Returns: A merged multimapthe other multimap that, BiFunction<Traversable<V>, Traversable<V2>, Traversable<V>> the collision resolution function collisionResolution)Creates a new multimap which by merging the entries of |
| public static < Key type K, Value type V> Multimap | |
| public Multimap | orElse(Iterable<? extends Tuple2<K, V>>
An alternative other)TraversableRedeclares io. Returns this |
| public Multimap | orElse(Supplier<? extends Iterable<? extends Tuple2<K, V>>>
An alternative supplier)Traversable supplierRedeclares io. Returns this |
| public Tuple2 | partition(Predicate<? super Tuple2<K, V>>
A predicate which classifies an element if it is in the first or the second traversable. predicate)Redeclares io. Creates a partition of this |
| public Multimap | peek(Consumer<? super Tuple2<K, V>>
The action that will be performed on the element(s). action)Redeclares io. Performs the given |
| public Multimap | Returns: A new Multimap containing these elements and that entry.key with which the specified value is to be associated key, V value to be associated with the specified key value)Associates the specified value with the specified key in this multimap. |
| public Multimap | |
| public Multimap | Returns: a new Multimapthe predicate used to test elements predicate)Returns a new Multimap consisting of all elements which do not satisfy the given predicate. |
| public Multimap | reject(Predicate<? super Tuple2<K, V>>
A predicate predicate)Redeclares as abstract: io. Returns a new traversable consisting of all elements which do not satisfy the given predicate. |
| public Multimap | Returns: a new Multimapthe predicate used to test keys of elements predicate)Returns a new Multimap consisting of all elements with keys which do not satisfy the given predicate. |
| public Multimap | Returns: a new Multimapthe predicate used to test values of elements predicate)Returns a new Multimap consisting of all elements with values which do not satisfy the given predicate. |
| public Multimap | Returns: A new Multimap containing these elements without the entry specified by that key.key whose mapping is to be removed from the multimap key)Removes the mapping for a key from this multimap if it is present. |
| public Multimap | Returns: A new Multimap containing these elements without the entry specified by that key and value.key whose mapping is to be removed from the multimap key, V value whose mapping is to be removed from the multimap value)Removes the key-value pair from this multimap if it is present. |
| public Multimap | Returns: a new Multimapthe predicate used to test elements predicate)
Deprecated
Please use
reject(BiPredicate)
Returns a new Multimap consisting of all elements which do not satisfy the given predicate. |
| public Multimap | |
| public Multimap | Returns: a new Multimapthe predicate used to test keys of elements predicate)
Deprecated
Please use
rejectKeys(Predicate)
Returns a new Multimap consisting of all elements with keys which do not satisfy the given predicate. |
| public Multimap | Returns: a new Multimapthe predicate used to test values of elements predicate)
Deprecated
Please use
rejectValues(Predicate)
Returns a new Multimap consisting of all elements with values which do not satisfy the given predicate. |
| public Multimap | replace(Tuple2<K, V>
An element to be substituted. currentElement, Tuple2<K, V> A replacement for currentElement. newElement)Redeclares io. Replaces the first occurrence (if exists) of the given currentElement with newElement. |
| public Multimap | Returns: a new map containing key mapped to newValue if key was contained before and oldValue was associated with the key. The old map otherwise.the key of the element to be substituted key, V the expected current value associated with the key oldValue, V the new value to be associated with the key newValue)Replaces the entry with the specified key and oldValue. |
| public Multimap | replaceAll(Tuple2<K, V>
An element to be substituted. currentElement, Tuple2<K, V> A replacement for currentElement. newElement)Redeclares io. Replaces all occurrences of the given currentElement with newElement. |
| public Multimap | Returns: a new map with the same keySet but transformed valuesfunction transforming key and current value to a new value function)Replaces each entry's values with the result of invoking the given function on that each tuple until all entries have been processed or the function throws an exception. |
| public Multimap | Returns: a new map containing key mapped to value if key was contained before. The old map otherwisethe key of the element to be substituted key, V the new value to be associated with the key value)Replaces the entry for the specified key only if it is currently mapped to some value. |
| public Multimap | retainAll(Iterable<? extends Tuple2<K, V>>
Elements to be kept. elements)Redeclares io. Keeps all occurrences of the given elements from this. |
| public Multimap | scan(Tuple2<K, V>
neutral element for the operator op zero, BiFunction<? super Tuple2<K, V>, ? super Tuple2<K, V>, ? extends Tuple2<K, V>> the associative operator for the scan operation)Redeclares io. Computes a prefix scan of the elements of the collection. |
| public default <U> Seq | scanLeft(U
the initial value zero, BiFunction<? super U, ? super Tuple2<K, V>, ? extends U> the binary operator applied to the intermediate result and the element operation)Implements io. Produces a collection containing cumulative results of applying the operator going left to right. |
| public default <U> Seq | scanRight(U
the initial value zero, BiFunction<? super Tuple2<K, V>, ? super U, ? extends U> the binary operator applied to the intermediate result and the element operation)Implements io. Produces a collection containing cumulative results of applying the operator going right to left. |
| public int | size()
Redeclares as abstract: io. Computes the number of elements of this Traversable. |
| public Iterator | slideBy(Function<? super Tuple2<K, V>, ?>
A function which classifies elements into classes classifier)Redeclares io. Slides a non-overlapping window of a variable size over this |
| public Iterator | sliding(int
a positive window size size)Redeclares io. Slides a window of a specific |
| public Iterator | sliding(int
a positive window size size, int a positive step size step)Redeclares io. Slides a window of a specific |
| public Tuple2 | span(Predicate<? super Tuple2<K, V>>
A predicate. predicate)Redeclares io. Returns a tuple where the first element is the longest prefix of elements that satisfy the given
|
| public Multimap | tail()
Redeclares io. Drops the first element of a non-empty Traversable. |
| public Option | tailOption()
Redeclares io. Drops the first element of a non-empty Traversable and returns an |
| public Multimap | take(int
The number of elements to take. n)Redeclares io. Takes the first n elements of this or all elements, if this length < n. |
| public Multimap | takeRight(int
The number of elements to take. n)Redeclares io. Takes the last n elements of this or all elements, if this length < n. |
| public Multimap | takeUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements. predicate)Redeclares io. Takes elements until the predicate holds for the current element. |
| public Multimap | takeWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for the contained elements. predicate)Redeclares io. Takes elements while the predicate holds for the current element. |
| public Map | Returns: a newjava.util.Map instanceConverts this Vavr |
| public default < Type of transformation result U> U | |
| public default <T1, T2> Tuple2 | |
| public default <T1, T2> Tuple2 | unzip(Function<? super Tuple2<K, V>, Tuple2<? extends T1, ? extends T2>>
a function which converts elements of this to pairs unzipper)Implements io. Unzips this elements by mapping this elements to pairs which are subsequently split into two distinct sets. |
| public default <T1, T2, T3> Tuple3 | |
| public default <T1, T2, T3> Tuple3 | unzip3(Function<? super Tuple2<K, V>, Tuple3<? extends T1, ? extends T2, ? extends T3>>
a function which converts elements of this to pairs unzipper)Implements io. Unzips this elements by mapping this elements to triples which are subsequently split into three distinct sets. |
| public Traversable | |
| public default <U> Seq | zip(Iterable<? extends U>
The Iterable providing the second half of each result pair. that)Implements io. Returns a traversable formed from this traversable and another Iterable collection by combining corresponding elements in pairs. |
| public default <U> Seq | zipAll(Iterable<? extends U>
The Iterable providing the second half of each result pair. that, Tuple2<K, V> 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)Implements io. Returns a traversable formed from this traversable and another Iterable by combining corresponding elements in pairs. |
| public default <U, R> Seq | zipWith(Iterable<? extends U>
The Iterable providing the second parameter of the mapper. that, BiFunction<? super Tuple2<K, V>, ? super U, ? extends R> a mapper. mapper)Implements io. Returns a traversable formed from this traversable and another Iterable collection by mapping elements. |
| public default Seq | zipWithIndex()
Implements io. Zips this traversable with its indices. |
| public default <U> Seq | zipWithIndex(BiFunction<? super Tuple2<K, V>, ? super Integer, ? extends U>
a mapper. mapper)Implements io. Zips this traversable with its indices by applying mapper provided. |