All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vavr.collection.SortedMultimap Maven / Gradle / Ivy

There is a newer version: 1.0.0-alpha-4
Show newest version
/*  __    __  __  __    __  ___
 * \  \  /  /    \  \  /  /  __/
 *  \  \/  /  /\  \  \/  /  /
 *   \____/__/  \__\____/__/
 *
 * 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} 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 map) {
        return (SortedMultimap) map;
    }

    @Override
    SortedMultimap filter(BiPredicate predicate);

    @Override
    SortedMultimap reject(BiPredicate predicate);

    @Override
    SortedMultimap filterKeys(Predicate predicate);

    @Override
    SortedMultimap rejectKeys(Predicate predicate);

    @Override
    SortedMultimap filterValues(Predicate predicate);

    @Override
    SortedMultimap rejectValues(Predicate predicate);

    @Override
    SortedSet keySet();

    @Override
    SortedMultimap merge(Multimap that);

    @Override
     SortedMultimap merge(Multimap that, BiFunction, Traversable, Traversable> collisionResolution);

    @Override
    SortedMultimap put(K key, V value);

    @Override
    SortedMultimap put(Tuple2 entry);

    @Override
    SortedMultimap remove(K key);

    @Override
    SortedMultimap remove(K key, V value);

    @Override
    @Deprecated
    SortedMultimap removeAll(BiPredicate predicate);

    @Override
    SortedMultimap removeAll(Iterable keys);

    @Override
    @Deprecated
    SortedMultimap removeKeys(Predicate predicate);

    @Override
    @Deprecated
    SortedMultimap removeValues(Predicate predicate);

    @Override
    java.util.SortedMap> toJavaMap();

    @Override
    SortedMultimap distinct();

    @Override
    SortedMultimap distinctBy(Comparator> comparator);

    @Override
     SortedMultimap distinctBy(Function, ? extends U> keyExtractor);

    @Override
    SortedMultimap drop(int n);

    @Override
    SortedMultimap dropRight(int n);

    @Override
    SortedMultimap dropUntil(Predicate> predicate);

    @Override
    SortedMultimap dropWhile(Predicate> predicate);

    @Override
    SortedMultimap filter(Predicate> predicate);

    @Override
    SortedMultimap reject(Predicate> predicate);

    @Override
     Map> groupBy(Function, ? extends C> classifier);

    @Override
    Iterator> grouped(int size);

    @Override
    SortedMultimap init();

    @Override
    Option> initOption();

    @Override
    SortedMultimap orElse(Iterable> other);

    @Override
    SortedMultimap orElse(Supplier>> supplier);

    @Override
    Tuple2, ? extends SortedMultimap> partition(Predicate> predicate);

    @Override
    SortedMultimap peek(Consumer> 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 function);

    @Override
    SortedMultimap retainAll(Iterable> elements);

    @Override
    SortedMultimap scan(Tuple2 zero,
                              BiFunction, ? super Tuple2, ? extends Tuple2> operation);

    @Override
    Iterator> slideBy(Function, ?> classifier);

    @Override
    Iterator> sliding(int size);

    @Override
    Iterator> sliding(int size, int step);

    @Override
    Tuple2, ? extends SortedMultimap> span(Predicate> predicate);

    @Override
    SortedMultimap tail();

    @Override
    Option> tailOption();

    @Override
    SortedMultimap take(int n);

    @Override
    SortedMultimap takeRight(int n);

    @Override
    SortedMultimap takeUntil(Predicate> predicate);

    @Override
    SortedMultimap takeWhile(Predicate> predicate);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy