Multimap implementation (not intended to be public).
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static interface |
| Modifier and Type | Field and Description |
|---|---|
| protected final Map | |
| private final Multimap. | |
| protected final AbstractMultimap. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | AbstractMultimap(Map<K, Traversable<V>> back, Multimap.
|
| Modifier and Type | Method and Description |
|---|---|
| public Map | |
| public <K2, V2> Multimap | bimap(Function<? super K, ? extends K2>
a 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 V2Implements io. Maps this |
| public boolean | containsKey(K
key whose presence in this multimap is to be tested key)Implements io. Returns |
| private <K2, V2> Multimap | |
| protected abstract <K2, V2> Multimap | |
| public M | distinct()
Implements io. Returns a new version of this which contains no duplicates. |
| public M | distinctBy(Comparator<? super Tuple2<K, V>>
A comparator comparator)Implements io. Returns a new version of this which contains no duplicates. |
| public <U> M | distinctBy(Function<? super Tuple2<K, V>, ? extends U>
A key extractor keyExtractor)Implements io. Returns a new version of this which contains no duplicates. |
| public M | drop(int
The number of elements to drop. n)Implements io. Drops the first n elements of this or all elements, if this length < n. |
| public M | dropRight(int
The number of elements to drop. n)Implements io. Drops the last n elements of this or all elements, if this length < n. |
| public M | dropUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements. predicate)Implements io. Drops elements until the predicate holds for the current element. |
| public M | dropWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements. predicate)Implements io. Drops elements while the predicate holds for the current element. |
| protected abstract <K2, V2> Multimap | |
| protected abstract <K2, V2> Map | |
| public boolean | equals(Object
an object, may be null o)Overrides java. Implements io. In Vavr there are four basic classes of collections:
|
| public M | filter(Predicate<? super Tuple2<K, V>>
A predicate predicate)Implements io. Returns a new traversable consisting of all elements which satisfy the given predicate. |
| public M | filter(BiPredicate<? super K, ? super V>
the predicate used to test elements predicate)Implements io. Returns a new Multimap consisting of all elements which satisfy the given predicate. |
| public M | filterKeys(Predicate<? super K>
the predicate used to test keys of elements predicate)Implements io. Returns a new Multimap consisting of all elements with keys which satisfy the given predicate. |
| public M | filterValues(Predicate<? super V>
the predicate used to test values of elements predicate)Implements io. Returns a new Multimap consisting of all elements with values which satisfy the given predicate. |
| public <K2, V2> Multimap | flatMap(BiFunction<? super K, ? super V, ? extends Iterable<Tuple2<K2, V2>>>
A mapper mapper)Implements io. FlatMaps this |
| public Option | get(K
the key whose associated value is to be returned key)Implements io. Returns the |
| public Multimap. | getContainerType()
Implements io. Returns the type of the |
| public Traversable | getOrElse(K
the key key, Traversable<? extends V> a default value defaultValue)Implements io. 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)Implements io. Groups this elements by classifying the elements. |
| public Iterator | grouped(int
a positive block size size)Implements io. Groups this |
| public int | hashCode()
Overrides java. Implements io. Returns the hash code of this collection. |
| public Tuple2 | head()
Implements io. Returns the first element of a non-empty Traversable. |
| public M | init()
Implements io. Dual of tail(), returning all elements except the last. |
| public Option | initOption()
Implements io. Dual of tailOption(), returning all elements except the last as |
| public boolean | isAsync()
Implements io. Checks if this |
| public boolean | isEmpty()
Overrides default io. Checks if this Traversable is empty. |
| public boolean | |
| public Iterator | iterator()
Implements io. An iterator by means of head() and tail(). |
| public Set | |
| public Tuple2 | |
| public <K2, V2> Multimap | map(BiFunction<? super K, ? super V, Tuple2<K2, V2>>
a mapper)Function that maps entries of type (K, V) to entries of type (K2, V2)Implements io. Maps the entries of this |
| public <V2> Multimap | mapValues(Function<? super V, ? extends V2>
a valueMapper)Function that maps values of type V to values of type V2Implements io. Maps the values of this |
| public M | merge(Multimap<? extends K, ? extends V>
the other multimap that)Implements io. Creates a new multimap which by merging the entries of |
| public <K2 extends K, V2 extends V> M | merge(Multimap<K2, V2>
the other multimap that, BiFunction<Traversable<V>, Traversable<V2>, Traversable<V>> the collision resolution function collisionResolution)Implements io. Creates a new multimap which by merging the entries of |
| public M | Returns: thisMultimap if it is nonempty,
otherwise Multimap created from iterable, using existing multimap properties.An alternative other)TraversableImplements io. Returns this |
| public M | Returns: thisMultimap if it is nonempty,
otherwise Multimap created from result of evaluating supplier, using existing multimap properties.An alternative supplier)TraversableImplements 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)Implements io. Creates a partition of this |
| public M | peek(Consumer<? super Tuple2<K, V>>
The action that will be performed on the element(s). action)Implements io. Performs the given |
| public M | put(K
key with which the specified value is to be associated key, V value to be associated with the specified key value)Implements io. Associates the specified value with the specified key in this multimap. |
| public M | put(Tuple2<? extends K, ? extends V>
A Tuple2 containing the key and value entry)Implements io. Convenience method for |
| public M | reject(Predicate<? super Tuple2<K, V>>
A predicate predicate)Implements io. Returns a new traversable consisting of all elements which do not satisfy the given predicate. |
| public M | reject(BiPredicate<? super K, ? super V>
the predicate used to test elements predicate)Implements io. Returns a new Multimap consisting of all elements which do not satisfy the given predicate. |
| public M | rejectKeys(Predicate<? super K>
the predicate used to test keys of elements predicate)Implements io. Returns a new Multimap consisting of all elements with keys which do not satisfy the given predicate. |
| public M | rejectValues(Predicate<? super V>
the predicate used to test values of elements predicate)Implements io. Returns a new Multimap consisting of all elements with values which do not satisfy the given predicate. |
| public M | remove(K
key whose mapping is to be removed from the multimap key)Implements io. Removes the mapping for a key from this multimap if it is present. |
| public M | remove(K
key whose mapping is to be removed from the multimap key, V value whose mapping is to be removed from the multimap value)Implements io. Removes the key-value pair from this multimap if it is present. |
| public M | removeAll(Iterable<? extends K>
keys are to be removed from the multimap keys)Implements io. Removes the mapping for a key from this multimap if it is present. |
| public M | removeAll(BiPredicate<? super K, ? super V>
the predicate used to test elements predicate)Implements io.
Deprecated
Returns a new Multimap consisting of all elements which do not satisfy the given predicate. |
| public M | removeKeys(Predicate<? super K>
the predicate used to test keys of elements predicate)Implements io.
Deprecated
Returns a new Multimap consisting of all elements with keys which do not satisfy the given predicate. |
| public M | removeValues(Predicate<? super V>
the predicate used to test values of elements predicate)Implements io.
Deprecated
Returns a new Multimap consisting of all elements with values which do not satisfy the given predicate. |
| public M | replace(Tuple2<K, V>
An element to be substituted. currentElement, Tuple2<K, V> A replacement for currentElement. newElement)Implements io. Replaces the first occurrence (if exists) of the given currentElement with newElement. |
| public M | replace(K
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)Implements io. Replaces the entry with the specified key and oldValue. |
| public M | replaceAll(Tuple2<K, V>
An element to be substituted. currentElement, Tuple2<K, V> A replacement for currentElement. newElement)Implements io. Replaces all occurrences of the given currentElement with newElement. |
| public M | replaceAll(BiFunction<? super K, ? super V, ? extends V>
function transforming key and current value to a new value function)Implements io. 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 M | replaceValue(K
the key of the element to be substituted key, V the new value to be associated with the key value)Implements io. Replaces the entry for the specified key only if it is currently mapped to some value. |
| public M | retainAll(Iterable<? extends Tuple2<K, V>>
Elements to be kept. elements)Implements io. Keeps all occurrences of the given elements from this. |
| public M | 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)Implements io. Computes a prefix scan of the elements of the collection. |
| public int | size()
Implements 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)Implements io. Slides a non-overlapping window of a variable size over this |
| public Iterator | sliding(int
a positive window size size)Implements io. Slides a window of a specific |
| public Iterator | sliding(int
a positive window size size, int a positive step size step)Implements io. Slides a window of a specific |
| public Tuple2 | span(Predicate<? super Tuple2<K, V>>
A predicate. predicate)Implements io. Returns a tuple where the first element is the longest prefix of elements that satisfy the given
|
| public String | stringPrefix()
Implements io. Returns the name of this Value type, which is used by toString(). |
| public M | tail()
Implements io. Drops the first element of a non-empty Traversable. |
| public Option | tailOption()
Implements io. Drops the first element of a non-empty Traversable and returns an |
| public M | take(int
The number of elements to take. n)Implements io. Takes the first n elements of this or all elements, if this length < n. |
| public M | takeRight(int
The number of elements to take. n)Implements io. Takes the last n elements of this or all elements, if this length < n. |
| public M | takeUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements. predicate)Implements io. Takes elements until the predicate holds for the current element. |
| public M | takeWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for the contained elements. predicate)Implements io. Takes elements while the predicate holds for the current element. |
| public Map | toJavaMap()
Implements io. Converts this Vavr |
| protected <JM extends Map | |
| public String | toString()
Overrides java. Implements io. Clarifies that values have a proper toString() method implemented. |
| public Traversable |