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

com.gs.collections.api.bimap.ImmutableBiMap Maven / Gradle / Ivy

/*
 * Copyright 2015 Goldman Sachs.
 *
 * 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 com.gs.collections.api.bimap;

import com.gs.collections.api.bag.ImmutableBagIterable;
import com.gs.collections.api.block.function.Function;
import com.gs.collections.api.block.function.Function2;
import com.gs.collections.api.block.predicate.Predicate;
import com.gs.collections.api.block.predicate.Predicate2;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.map.ImmutableMapIterable;
import com.gs.collections.api.multimap.set.ImmutableSetMultimap;
import com.gs.collections.api.partition.set.PartitionImmutableSet;
import com.gs.collections.api.set.ImmutableSet;
import com.gs.collections.api.tuple.Pair;

/**
 * A {@link BiMap} whose contents cannot be altered after initialization.
 *
 * @since 4.2
 */
public interface ImmutableBiMap extends BiMap, ImmutableMapIterable
{
    ImmutableBiMap newWithKeyValue(K key, V value);

    ImmutableBiMap newWithAllKeyValues(Iterable> keyValues);

    ImmutableBiMap newWithAllKeyValueArguments(Pair... keyValuePairs);

    ImmutableBiMap newWithoutKey(K key);

    ImmutableBiMap newWithoutAllKeys(Iterable keys);

    ImmutableBiMap inverse();

    ImmutableSetMultimap flip();

    ImmutableBiMap flipUniqueValues();

    ImmutableBiMap tap(Procedure procedure);

    ImmutableBiMap select(Predicate2 predicate);

    ImmutableBiMap reject(Predicate2 predicate);

     ImmutableBiMap collect(Function2> function);

     ImmutableBiMap collectValues(Function2 function);

    ImmutableSet select(Predicate predicate);

    

ImmutableSet selectWith(Predicate2 predicate, P parameter); ImmutableSet reject(Predicate predicate);

ImmutableSet rejectWith(Predicate2 predicate, P parameter); PartitionImmutableSet partition(Predicate predicate);

PartitionImmutableSet partitionWith(Predicate2 predicate, P parameter); ImmutableSet selectInstancesOf(Class clazz); ImmutableBagIterable collect(Function function); ImmutableBagIterable collectWith(Function2 function, P parameter); ImmutableBagIterable collectIf(Predicate predicate, Function function); ImmutableBagIterable flatCollect(Function> function); ImmutableSetMultimap groupBy(Function function); ImmutableSetMultimap groupByEach(Function> function); ImmutableBiMap groupByUniqueKey(Function function); ImmutableSet> zip(Iterable that); ImmutableSet> zipWithIndex(); }