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

org.eclipse.collections.impl.bimap.AbstractBiMap Maven / Gradle / Ivy

There is a newer version: 12.0.0.M3
Show newest version
/*
 * Copyright (c) 2016 Goldman Sachs.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v. 1.0 which accompany this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 */

package org.eclipse.collections.impl.bimap;

import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import java.util.Optional;

import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.bag.MutableBag;
import org.eclipse.collections.api.bag.sorted.MutableSortedBag;
import org.eclipse.collections.api.bimap.BiMap;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function0;
import org.eclipse.collections.api.block.function.Function2;
import org.eclipse.collections.api.block.function.primitive.BooleanFunction;
import org.eclipse.collections.api.block.function.primitive.ByteFunction;
import org.eclipse.collections.api.block.function.primitive.CharFunction;
import org.eclipse.collections.api.block.function.primitive.DoubleFunction;
import org.eclipse.collections.api.block.function.primitive.DoubleObjectToDoubleFunction;
import org.eclipse.collections.api.block.function.primitive.FloatFunction;
import org.eclipse.collections.api.block.function.primitive.FloatObjectToFloatFunction;
import org.eclipse.collections.api.block.function.primitive.IntFunction;
import org.eclipse.collections.api.block.function.primitive.IntObjectToIntFunction;
import org.eclipse.collections.api.block.function.primitive.LongFunction;
import org.eclipse.collections.api.block.function.primitive.LongObjectToLongFunction;
import org.eclipse.collections.api.block.function.primitive.ShortFunction;
import org.eclipse.collections.api.block.predicate.Predicate;
import org.eclipse.collections.api.block.predicate.Predicate2;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.Procedure2;
import org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure;
import org.eclipse.collections.api.collection.primitive.MutableBooleanCollection;
import org.eclipse.collections.api.collection.primitive.MutableByteCollection;
import org.eclipse.collections.api.collection.primitive.MutableCharCollection;
import org.eclipse.collections.api.collection.primitive.MutableDoubleCollection;
import org.eclipse.collections.api.collection.primitive.MutableFloatCollection;
import org.eclipse.collections.api.collection.primitive.MutableIntCollection;
import org.eclipse.collections.api.collection.primitive.MutableLongCollection;
import org.eclipse.collections.api.collection.primitive.MutableShortCollection;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.map.MapIterable;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.map.sorted.MutableSortedMap;
import org.eclipse.collections.api.multimap.MutableMultimap;
import org.eclipse.collections.api.ordered.OrderedIterable;
import org.eclipse.collections.api.set.MutableSet;
import org.eclipse.collections.api.set.sorted.MutableSortedSet;
import org.eclipse.collections.api.tuple.Pair;

public abstract class AbstractBiMap implements BiMap
{
    protected abstract MapIterable getDelegate();

    protected abstract MapIterable getInverse();

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj)
        {
            return true;
        }
        if (!(obj instanceof Map))
        {
            return false;
        }

        Map map = (Map) obj;

        return this.getDelegate().equals(map);
    }

    @Override
    public int hashCode()
    {
        return this.getDelegate().hashCode();
    }

    @Override
    public int size()
    {
        return this.getDelegate().size();
    }

    @Override
    public V get(Object key)
    {
        return this.getDelegate().get(key);
    }

    @Override
    public V getFirst()
    {
        return this.getDelegate().getFirst();
    }

    @Override
    public V getLast()
    {
        return this.getDelegate().getLast();
    }

    @Override
    public V getOnly()
    {
        return this.getDelegate().getOnly();
    }

    @Override
    public V getIfAbsent(K key, Function0 function)
    {
        return this.getDelegate().getIfAbsent(key, function);
    }

    @Override
    public V getIfAbsentValue(K key, V value)
    {
        return this.getDelegate().getIfAbsentValue(key, value);
    }

    @Override
    public 

V getIfAbsentWith(K key, Function function, P parameter) { return this.getDelegate().getIfAbsentWith(key, function, parameter); } @Override public A ifPresentApply(K key, Function function) { return this.getDelegate().ifPresentApply(key, function); } @Override public boolean isEmpty() { return this.getDelegate().isEmpty(); } @Override public boolean notEmpty() { return this.getDelegate().notEmpty(); } @Override public boolean contains(Object object) { return this.getInverse().containsKey(object); } @Override public boolean containsKey(Object key) { return this.getDelegate().containsKey(key); } @Override public boolean containsValue(Object value) { return this.getInverse().containsKey(value); } @Override public boolean containsAllIterable(Iterable source) { return this.getInverse().keysView().containsAllIterable(source); } @Override public boolean containsAll(Collection source) { return this.getInverse().keysView().containsAll(source); } @Override public boolean containsAllArguments(Object... elements) { return this.getInverse().keysView().containsAllArguments(elements); } @Override public RichIterable keysView() { return this.getDelegate().keysView(); } @Override public RichIterable valuesView() { return this.getDelegate().valuesView(); } @Override public RichIterable> keyValuesView() { return this.getDelegate().keyValuesView(); } @Override public > R into(R target) { return this.getDelegate().into(target); } @Override public MutableList toList() { return this.getDelegate().toList(); } @Override public MutableList toSortedList() { return this.getDelegate().toSortedList(); } @Override public MutableList toSortedList(Comparator comparator) { return this.getDelegate().toSortedList(comparator); } @Override public > MutableList toSortedListBy(Function function) { return this.getDelegate().toSortedListBy(function); } @Override public MutableSet toSet() { return this.getDelegate().toSet(); } @Override public MutableSortedSet toSortedSet() { return this.getDelegate().toSortedSet(); } @Override public MutableSortedSet toSortedSet(Comparator comparator) { return this.getDelegate().toSortedSet(comparator); } @Override public > MutableSortedSet toSortedSetBy(Function function) { return this.getDelegate().toSortedSetBy(function); } @Override public MutableBag toBag() { return this.getDelegate().toBag(); } @Override public MutableSortedBag toSortedBag() { return this.getDelegate().toSortedBag(); } @Override public MutableSortedBag toSortedBag(Comparator comparator) { return this.getDelegate().toSortedBag(comparator); } @Override public > MutableSortedBag toSortedBagBy(Function function) { return this.getDelegate().toSortedBagBy(function); } @Override public MutableMap toMap(Function keyFunction, Function valueFunction) { return this.getDelegate().toMap(keyFunction, valueFunction); } @Override public MutableSortedMap toSortedMap(Function keyFunction, Function valueFunction) { return this.getDelegate().toSortedMap(keyFunction, valueFunction); } @Override public MutableSortedMap toSortedMap(Comparator comparator, Function keyFunction, Function valueFunction) { return this.getDelegate().toSortedMap(comparator, keyFunction, valueFunction); } @Override public Object[] toArray() { return this.getDelegate().toArray(); } @Override public T[] toArray(T[] a) { return this.getDelegate().toArray(a); } @Override public String toString() { return this.getDelegate().toString(); } @Override public String makeString() { return this.getDelegate().makeString(); } @Override public String makeString(String separator) { return this.getDelegate().makeString(separator); } @Override public String makeString(String start, String separator, String end) { return this.getDelegate().makeString(start, separator, end); } @Override public void appendString(Appendable appendable) { this.getDelegate().appendString(appendable); } @Override public void appendString(Appendable appendable, String separator) { this.getDelegate().appendString(appendable, separator); } @Override public void appendString(Appendable appendable, String start, String separator, String end) { this.getDelegate().appendString(appendable, start, separator, end); } @Override public void forEachValue(Procedure procedure) { this.getDelegate().forEachValue(procedure); } @Override public void forEachKey(Procedure procedure) { this.getDelegate().forEachKey(procedure); } @Override public void forEachKeyValue(Procedure2 procedure) { this.getDelegate().forEachKeyValue(procedure); } @Override public void each(Procedure procedure) { this.getDelegate().forEachValue(procedure); } @Override public void forEach(Procedure procedure) { this.each(procedure); } @Override public void forEachWithIndex(ObjectIntProcedure objectIntProcedure) { this.getDelegate().forEachWithIndex(objectIntProcedure); } @Override public

void forEachWith(Procedure2 procedure, P parameter) { this.getDelegate().forEachWith(procedure, parameter); } @Override public LazyIterable asLazy() { return this.getDelegate().asLazy(); } @Override public int count(Predicate predicate) { return this.getDelegate().count(predicate); } @Override public

int countWith(Predicate2 predicate, P parameter) { return this.getDelegate().countWith(predicate, parameter); } @Override public V min(Comparator comparator) { return this.getDelegate().min(comparator); } @Override public V min() { return this.getDelegate().min(); } @Override public > V minBy(Function function) { return this.getDelegate().minBy(function); } @Override public V max(Comparator comparator) { return this.getDelegate().max(comparator); } @Override public V max() { return this.getDelegate().max(); } @Override public > V maxBy(Function function) { return this.getDelegate().maxBy(function); } @Override public Pair detect(Predicate2 predicate) { return this.getDelegate().detect(predicate); } @Override public V detect(Predicate predicate) { return this.getDelegate().detect(predicate); } @Override public

V detectWith(Predicate2 predicate, P parameter) { return this.getDelegate().detectWith(predicate, parameter); } @Override public Optional> detectOptional(Predicate2 predicate) { return this.getDelegate().detectOptional(predicate); } @Override public Optional detectOptional(Predicate predicate) { return this.getDelegate().detectOptional(predicate); } @Override public

Optional detectWithOptional(Predicate2 predicate, P parameter) { return this.getDelegate().detectWithOptional(predicate, parameter); } @Override public V detectIfNone(Predicate predicate, Function0 function) { return this.getDelegate().detectIfNone(predicate, function); } @Override public

V detectWithIfNone(Predicate2 predicate, P parameter, Function0 function) { return this.getDelegate().detectWithIfNone(predicate, parameter, function); } @Override public boolean anySatisfy(Predicate predicate) { return this.getDelegate().anySatisfy(predicate); } @Override public

boolean anySatisfyWith(Predicate2 predicate, P parameter) { return this.getDelegate().anySatisfyWith(predicate, parameter); } @Override public boolean allSatisfy(Predicate predicate) { return this.getDelegate().allSatisfy(predicate); } @Override public

boolean allSatisfyWith(Predicate2 predicate, P parameter) { return this.getDelegate().allSatisfyWith(predicate, parameter); } @Override public boolean noneSatisfy(Predicate predicate) { return this.getDelegate().noneSatisfy(predicate); } @Override public

boolean noneSatisfyWith(Predicate2 predicate, P parameter) { return this.getDelegate().noneSatisfyWith(predicate, parameter); } @Override public > R collect(Function function, R target) { return this.getDelegate().collect(function, target); } @Override public R collectBoolean(BooleanFunction booleanFunction, R target) { return this.getDelegate().collectBoolean(booleanFunction, target); } @Override public R collectByte(ByteFunction byteFunction, R target) { return this.getDelegate().collectByte(byteFunction, target); } @Override public R collectChar(CharFunction charFunction, R target) { return this.getDelegate().collectChar(charFunction, target); } @Override public R collectDouble(DoubleFunction doubleFunction, R target) { return this.getDelegate().collectDouble(doubleFunction, target); } @Override public R collectFloat(FloatFunction floatFunction, R target) { return this.getDelegate().collectFloat(floatFunction, target); } @Override public R collectInt(IntFunction intFunction, R target) { return this.getDelegate().collectInt(intFunction, target); } @Override public R collectLong(LongFunction longFunction, R target) { return this.getDelegate().collectLong(longFunction, target); } @Override public R collectShort(ShortFunction shortFunction, R target) { return this.getDelegate().collectShort(shortFunction, target); } @Override public > R collectWith(Function2 function, P parameter, R targetCollection) { return this.getDelegate().collectWith(function, parameter, targetCollection); } @Override public > R collectIf(Predicate predicate, Function function, R target) { return this.getDelegate().collectIf(predicate, function, target); } @Override public > R flatCollect(Function> function, R target) { return this.getDelegate().flatCollect(function, target); } @Override public > R select(Predicate predicate, R target) { return this.getDelegate().select(predicate, target); } @Override public > R selectWith(Predicate2 predicate, P parameter, R targetCollection) { return this.getDelegate().selectWith(predicate, parameter, targetCollection); } @Override public > R reject(Predicate predicate, R target) { return this.getDelegate().reject(predicate, target); } @Override public > R rejectWith(Predicate2 predicate, P parameter, R targetCollection) { return this.getDelegate().rejectWith(predicate, parameter, targetCollection); } /** * @deprecated in 8.0. Use {@link OrderedIterable#zip(Iterable, R)} instead. */ @Override @Deprecated public >> R zip(Iterable that, R target) { return this.getDelegate().zip(that, target); } /** * @deprecated in 8.0. Use {@link OrderedIterable#zipWithIndex(R)} instead. */ @Override @Deprecated public >> R zipWithIndex(R target) { return this.getDelegate().zipWithIndex(target); } @Override public RichIterable> chunk(int size) { return this.getDelegate().chunk(size); } @Override public > R groupBy(Function function, R target) { return this.getDelegate().groupBy(function, target); } @Override public > R groupByEach(Function> function, R target) { return this.getDelegate().groupByEach(function, target); } @Override public > R groupByUniqueKey(Function function, R target) { return this.getDelegate().groupByUniqueKey(function, target); } @Override public IV injectInto(IV injectedValue, Function2 function) { return this.getDelegate().injectInto(injectedValue, function); } @Override public int injectInto(int injectedValue, IntObjectToIntFunction function) { return this.getDelegate().injectInto(injectedValue, function); } @Override public long injectInto(long injectedValue, LongObjectToLongFunction function) { return this.getDelegate().injectInto(injectedValue, function); } @Override public float injectInto(float injectedValue, FloatObjectToFloatFunction function) { return this.getDelegate().injectInto(injectedValue, function); } @Override public double injectInto(double injectedValue, DoubleObjectToDoubleFunction function) { return this.getDelegate().injectInto(injectedValue, function); } @Override public long sumOfInt(IntFunction function) { return this.getDelegate().sumOfInt(function); } @Override public double sumOfFloat(FloatFunction function) { return this.getDelegate().sumOfFloat(function); } @Override public long sumOfLong(LongFunction function) { return this.getDelegate().sumOfLong(function); } @Override public double sumOfDouble(DoubleFunction function) { return this.getDelegate().sumOfDouble(function); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy