io.vavr.collection.SortedMultimap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vavr Show documentation
Show all versions of vavr Show documentation
Vavr is an object-functional library for Java 8+
/* __ __ __ __ __ ___
* \ \ / / \ \ / / __/
* \ \/ / /\ \ \/ / /
* \____/__/ \__\____/__/
*
* Copyright 2014-2019 Vavr, http://vavr.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.vavr.collection;
import io.vavr.control.Option;
import io.vavr.Tuple2;
import java.util.Collection;
import java.util.Comparator;
import java.util.function.*;
/**
* An immutable {@code SortedMultimap} interface.
*
* @param Key type
* @param Value type
* @author Ruslan Sennov
*/
public interface SortedMultimap extends Multimap, Ordered {
long serialVersionUID = 1L;
/**
* Narrows a widened {@code SortedMultimap extends K, ? extends V>} to {@code SortedMultimap}
* by performing a type-safe cast. This is eligible because immutable/read-only
* collections are covariant.
*
* @param map A {@code SortedMultimap}.
* @param Key type
* @param Value type
* @return the given {@code multimap} instance as narrowed type {@code SortedMultimap}.
*/
@SuppressWarnings("unchecked")
static SortedMultimap narrow(SortedMultimap extends K, ? extends V> map) {
return (SortedMultimap) map;
}
@Override
SortedMultimap filter(BiPredicate super K, ? super V> predicate);
@Override
SortedMultimap reject(BiPredicate super K, ? super V> predicate);
@Override
SortedMultimap filterKeys(Predicate super K> predicate);
@Override
SortedMultimap rejectKeys(Predicate super K> predicate);
@Override
SortedMultimap filterValues(Predicate super V> predicate);
@Override
SortedMultimap rejectValues(Predicate super V> predicate);
@Override
SortedSet keySet();
@Override
SortedMultimap merge(Multimap extends K, ? extends V> that);
@Override
SortedMultimap merge(Multimap that, BiFunction, Traversable, Traversable> collisionResolution);
@Override
SortedMultimap put(K key, V value);
@Override
SortedMultimap put(Tuple2 extends K, ? extends V> entry);
@Override
SortedMultimap remove(K key);
@Override
SortedMultimap remove(K key, V value);
@Override
@Deprecated
SortedMultimap removeAll(BiPredicate super K, ? super V> predicate);
@Override
SortedMultimap removeAll(Iterable extends K> keys);
@Override
@Deprecated
SortedMultimap removeKeys(Predicate super K> predicate);
@Override
@Deprecated
SortedMultimap removeValues(Predicate super V> predicate);
@Override
java.util.SortedMap> toJavaMap();
@Override
SortedMultimap distinct();
@Override
SortedMultimap distinctBy(Comparator super Tuple2> comparator);
@Override
SortedMultimap distinctBy(Function super Tuple2, ? extends U> keyExtractor);
@Override
SortedMultimap drop(int n);
@Override
SortedMultimap dropRight(int n);
@Override
SortedMultimap dropUntil(Predicate super Tuple2> predicate);
@Override
SortedMultimap dropWhile(Predicate super Tuple2> predicate);
@Override
SortedMultimap filter(Predicate super Tuple2> predicate);
@Override
SortedMultimap reject(Predicate super Tuple2> predicate);
@Override
Map> groupBy(Function super Tuple2, ? extends C> classifier);
@Override
Iterator extends SortedMultimap> grouped(int size);
@Override
SortedMultimap init();
@Override
Option extends SortedMultimap> initOption();
@Override
SortedMultimap orElse(Iterable extends Tuple2> other);
@Override
SortedMultimap orElse(Supplier extends Iterable extends Tuple2>> supplier);
@Override
Tuple2 extends SortedMultimap, ? extends SortedMultimap> partition(Predicate super Tuple2> predicate);
@Override
SortedMultimap peek(Consumer super Tuple2> action);
@Override
SortedMultimap replace(Tuple2 currentElement, Tuple2 newElement);
@Override
SortedMultimap replaceAll(Tuple2 currentElement, Tuple2 newElement);
@Override
SortedMultimap replaceValue(K key, V value);
@Override
SortedMultimap replace(K key, V oldValue, V newValue);
@Override
SortedMultimap replaceAll(BiFunction super K, ? super V, ? extends V> function);
@Override
SortedMultimap retainAll(Iterable extends Tuple2> elements);
@Override
SortedMultimap scan(Tuple2 zero,
BiFunction super Tuple2, ? super Tuple2, ? extends Tuple2> operation);
@Override
Iterator extends SortedMultimap> slideBy(Function super Tuple2, ?> classifier);
@Override
Iterator extends SortedMultimap> sliding(int size);
@Override
Iterator extends SortedMultimap> sliding(int size, int step);
@Override
Tuple2 extends SortedMultimap, ? extends SortedMultimap> span(Predicate super Tuple2> predicate);
@Override
SortedMultimap tail();
@Override
Option extends SortedMultimap> tailOption();
@Override
SortedMultimap take(int n);
@Override
SortedMultimap takeRight(int n);
@Override
SortedMultimap takeUntil(Predicate super Tuple2> predicate);
@Override
SortedMultimap takeWhile(Predicate super Tuple2> predicate);
}