Top Description Fields Methods
io.vavr.collection

public Interface SortedMultimap<K, V>

extends Multimap<K, V>, Ordered<K>
Known Direct Implementers
io.vavr.collection.TreeMultimap
Type Parameters
<K>
Key type
<V>
Value type
Imports
io.vavr.control.Option, io.vavr.Tuple2, java.util.Collection, .Comparator, java.util.function.*

An immutable SortedMultimap interface.
Author
Ruslan Sennov

Field Summary

Modifier and TypeField and Description
public static final long

Method Summary

Modifier and TypeMethod and Description
public SortedMultimap<K, V>
distinct()

Redeclares io.vavr.collection.Multimap.distinct.

Returns a new version of this which contains no duplicates.

public SortedMultimap<K, V>
distinctBy(Comparator<? super Tuple2<K, V>>
A comparator
comparator
)

Redeclares io.vavr.collection.Multimap.distinctBy.

Returns a new version of this which contains no duplicates.

public <U> SortedMultimap<K, V>
distinctBy(Function<? super Tuple2<K, V>, ? extends U>
A key extractor
keyExtractor
)

Redeclares io.vavr.collection.Multimap.distinctBy.

Returns a new version of this which contains no duplicates.

public SortedMultimap<K, V>
drop(int
The number of elements to drop.
n
)

Redeclares io.vavr.collection.Multimap.drop.

Drops the first n elements of this or all elements, if this length < n.

public SortedMultimap<K, V>
dropRight(int
The number of elements to drop.
n
)

Redeclares io.vavr.collection.Multimap.dropRight.

Drops the last n elements of this or all elements, if this length < n.

public SortedMultimap<K, V>
dropUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements.
predicate
)

Redeclares io.vavr.collection.Multimap.dropUntil.

Drops elements until the predicate holds for the current element.

public SortedMultimap<K, V>
dropWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements.
predicate
)

Redeclares io.vavr.collection.Multimap.dropWhile.

Drops elements while the predicate holds for the current element.

public SortedMultimap<K, V>
filter(BiPredicate<? super K, ? super V>
the predicate used to test elements
predicate
)

Redeclares io.vavr.collection.Multimap.filter.

Returns a new Multimap consisting of all elements which satisfy the given predicate.

public SortedMultimap<K, V>
filter(Predicate<? super Tuple2<K, V>>
A predicate
predicate
)

Redeclares io.vavr.collection.Multimap.filter.

Returns a new traversable consisting of all elements which satisfy the given predicate.

public SortedMultimap<K, V>
filterKeys(Predicate<? super K>
the predicate used to test keys of elements
predicate
)

Redeclares io.vavr.collection.Multimap.filterKeys.

Returns a new Multimap consisting of all elements with keys which satisfy the given predicate.

public SortedMultimap<K, V>
filterValues(Predicate<? super V>
the predicate used to test values of elements
predicate
)

Redeclares io.vavr.collection.Multimap.filterValues.

Returns a new Multimap consisting of all elements with values which satisfy the given predicate.

public <C> Map<C, ? extends SortedMultimap<K, V>>
groupBy(Function<? super Tuple2<K, V>, ? extends C>
A function which classifies elements into classes
classifier
)

Redeclares io.vavr.collection.Multimap.groupBy.

Groups this elements by classifying the elements.

public Iterator<? extends SortedMultimap<K, V>>
grouped(int
a positive block size
size
)

Redeclares io.vavr.collection.Multimap.grouped.

Groups this Traversable into fixed size blocks.

public SortedMultimap<K, V>
init()

Redeclares io.vavr.collection.Multimap.init.

Dual of tail(), returning all elements except the last.

public Option<? extends SortedMultimap<K, V>>
initOption()

Redeclares io.vavr.collection.Multimap.initOption.

Dual of tailOption(), returning all elements except the last as Option.

public SortedSet<K>
keySet()

Redeclares io.vavr.collection.Multimap.keySet.

Returns the keys contained in this multimap.

public SortedMultimap<K, V>
merge(Multimap<? extends K, ? extends V>
the other multimap
that
)

Redeclares io.vavr.collection.Multimap.merge.

Creates a new multimap which by merging the entries of this multimap and that multimap.

public <K2 extends K, V2 extends V> SortedMultimap<K, V>
merge(Multimap<K2, V2>
the other multimap
that
,
BiFunction<Traversable<V>, Traversable<V2>, Traversable<V>>
the collision resolution function
collisionResolution
)

Redeclares io.vavr.collection.Multimap.merge.

Creates a new multimap which by merging the entries of this multimap and that multimap.

public static <
Key type
K
,
Value type
V
>
SortedMultimap<K, V>

Returns:

the given multimap instance as narrowed type SortedMultimap<K, V>.
narrow
(SortedMultimap<? extends K, ? extends V>
A SortedMultimap.
map
)

Narrows a widened SortedMultimap<?

public SortedMultimap<K, V>
orElse(Iterable<? extends Tuple2<K, V>>
An alternative Traversable
other
)

Redeclares io.vavr.collection.Multimap.orElse.

Returns this Traversable if it is nonempty, otherwise return the alternative.

public SortedMultimap<K, V>
orElse(Supplier<? extends Iterable<? extends Tuple2<K, V>>>
An alternative Traversable supplier
supplier
)

Redeclares io.vavr.collection.Multimap.orElse.

Returns this Traversable if it is nonempty, otherwise return the result of evaluating supplier.

public Tuple2<? extends SortedMultimap<K, V>, ? extends SortedMultimap<K, V>>
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.vavr.collection.Multimap.partition.

Creates a partition of this Traversable by splitting this elements in two in distinct traversables according to a predicate.

public SortedMultimap<K, V>
peek(Consumer<? super Tuple2<K, V>>
The action that will be performed on the element(s).
action
)

Redeclares io.vavr.collection.Multimap.peek.

Performs the given action on the first element if this is an eager implementation.

public SortedMultimap<K, V>
put(K
key with which the specified value is to be associated
key
,
V
value to be associated with the specified key
value
)

Redeclares io.vavr.collection.Multimap.put.

Associates the specified value with the specified key in this multimap.

public SortedMultimap<K, V>
put(Tuple2<? extends K, ? extends V>
A Tuple2 containing the key and value
entry
)

Redeclares io.vavr.collection.Multimap.put.

Convenience method for put(entry._1, entry._2).

public SortedMultimap<K, V>
reject(BiPredicate<? super K, ? super V>
the predicate used to test elements
predicate
)

Redeclares io.vavr.collection.Multimap.reject.

Returns a new Multimap consisting of all elements which do not satisfy the given predicate.

public SortedMultimap<K, V>
reject(Predicate<? super Tuple2<K, V>>
A predicate
predicate
)

Redeclares io.vavr.collection.Multimap.reject.

Returns a new traversable consisting of all elements which do not satisfy the given predicate.

public SortedMultimap<K, V>
rejectKeys(Predicate<? super K>
the predicate used to test keys of elements
predicate
)

Redeclares io.vavr.collection.Multimap.rejectKeys.

Returns a new Multimap consisting of all elements with keys which do not satisfy the given predicate.

public SortedMultimap<K, V>
rejectValues(Predicate<? super V>
the predicate used to test values of elements
predicate
)

Redeclares io.vavr.collection.Multimap.rejectValues.

Returns a new Multimap consisting of all elements with values which do not satisfy the given predicate.

public SortedMultimap<K, V>
remove(K
key whose mapping is to be removed from the multimap
key
)

Redeclares io.vavr.collection.Multimap.remove.

Removes the mapping for a key from this multimap if it is present.

public SortedMultimap<K, V>
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
)

Redeclares io.vavr.collection.Multimap.remove.

Removes the key-value pair from this multimap if it is present.

public SortedMultimap<K, V>
removeAll(BiPredicate<? super K, ? super V>
the predicate used to test elements
predicate
)

Redeclares io.vavr.collection.Multimap.removeAll.

Deprecated

Returns a new Multimap consisting of all elements which do not satisfy the given predicate.

public SortedMultimap<K, V>
removeAll(Iterable<? extends K>
keys are to be removed from the multimap
keys
)

Redeclares io.vavr.collection.Multimap.removeAll.

Removes the mapping for a key from this multimap if it is present.

public SortedMultimap<K, V>
removeKeys(Predicate<? super K>
the predicate used to test keys of elements
predicate
)

Redeclares io.vavr.collection.Multimap.removeKeys.

Deprecated

Returns a new Multimap consisting of all elements with keys which do not satisfy the given predicate.

public SortedMultimap<K, V>
removeValues(Predicate<? super V>
the predicate used to test values of elements
predicate
)

Redeclares io.vavr.collection.Multimap.removeValues.

Deprecated

Returns a new Multimap consisting of all elements with values which do not satisfy the given predicate.

public SortedMultimap<K, V>
replace(Tuple2<K, V>
An element to be substituted.
currentElement
,
Tuple2<K, V>
A replacement for currentElement.
newElement
)

Redeclares io.vavr.collection.Multimap.replace.

Replaces the first occurrence (if exists) of the given currentElement with newElement.

public SortedMultimap<K, V>
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
)

Redeclares io.vavr.collection.Multimap.replace.

Replaces the entry with the specified key and oldValue.

public SortedMultimap<K, V>
replaceAll(Tuple2<K, V>
An element to be substituted.
currentElement
,
Tuple2<K, V>
A replacement for currentElement.
newElement
)

Redeclares io.vavr.collection.Multimap.replaceAll.

Replaces all occurrences of the given currentElement with newElement.

public SortedMultimap<K, V>
replaceAll(BiFunction<? super K, ? super V, ? extends V>
function transforming key and current value to a new value
function
)

Redeclares io.vavr.collection.Multimap.replaceAll.

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 SortedMultimap<K, V>
replaceValue(K
the key of the element to be substituted
key
,
V
the new value to be associated with the key
value
)

Redeclares io.vavr.collection.Multimap.replaceValue.

Replaces the entry for the specified key only if it is currently mapped to some value.

public SortedMultimap<K, V>
retainAll(Iterable<? extends Tuple2<K, V>>
Elements to be kept.
elements
)

Redeclares io.vavr.collection.Multimap.retainAll.

Keeps all occurrences of the given elements from this.

public SortedMultimap<K, V>
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.vavr.collection.Multimap.scan.

Computes a prefix scan of the elements of the collection.

public Iterator<? extends SortedMultimap<K, V>>
slideBy(Function<? super Tuple2<K, V>, ?>
A function which classifies elements into classes
classifier
)

Redeclares io.vavr.collection.Multimap.slideBy.

Slides a non-overlapping window of a variable size over this Traversable.

public Iterator<? extends SortedMultimap<K, V>>
sliding(int
a positive window size
size
)

Redeclares io.vavr.collection.Multimap.sliding.

Slides a window of a specific size and step size 1 over this Traversable by calling sliding(int, int).

public Iterator<? extends SortedMultimap<K, V>>
sliding(int
a positive window size
size
,
int
a positive step size
step
)

Redeclares io.vavr.collection.Multimap.sliding.

Slides a window of a specific size and step size over this Traversable.

public Tuple2<? extends SortedMultimap<K, V>, ? extends SortedMultimap<K, V>>
span(Predicate<? super Tuple2<K, V>>
A predicate.
predicate
)

Redeclares io.vavr.collection.Multimap.span.

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.

public SortedMultimap<K, V>
tail()

Redeclares io.vavr.collection.Multimap.tail.

Drops the first element of a non-empty Traversable.

public Option<? extends SortedMultimap<K, V>>
tailOption()

Redeclares io.vavr.collection.Multimap.tailOption.

Drops the first element of a non-empty Traversable and returns an Option.

public SortedMultimap<K, V>
take(int
The number of elements to take.
n
)

Redeclares io.vavr.collection.Multimap.take.

Takes the first n elements of this or all elements, if this length < n.

public SortedMultimap<K, V>
takeRight(int
The number of elements to take.
n
)

Redeclares io.vavr.collection.Multimap.takeRight.

Takes the last n elements of this or all elements, if this length < n.

public SortedMultimap<K, V>
takeUntil(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for this elements.
predicate
)

Redeclares io.vavr.collection.Multimap.takeUntil.

Takes elements until the predicate holds for the current element.

public SortedMultimap<K, V>
takeWhile(Predicate<? super Tuple2<K, V>>
A condition tested subsequently for the contained elements.
predicate
)

Redeclares io.vavr.collection.Multimap.takeWhile.

Takes elements while the predicate holds for the current element.

public SortedMap<K, Collection<V>>
toJavaMap()

Redeclares io.vavr.collection.Multimap.toJavaMap.

Converts this Vavr Map to a java.util.Map while preserving characteristics like insertion order (LinkedHashMultimap) and sort order (SortedMultimap).

Inherited from io.vavr.collection.Multimap:
applyasMapasPartialFunctionbimapcollectcontainscontainsKeycontainsValueflatMapflatMapfoldRightforEachgetgetContainerTypegetOrElsehasDefiniteSizeisDefinedAtisDistinctisTraversableAgainiteratoriteratorlengthmapmapmapValuesnarrowscanLeftscanRightsizetransformunzipunzipunzip3unzip3valueszipzipAllzipWithzipWithIndexzipWithIndex
Inherited from io.vavr.collection.Ordered:
comparator