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

com.gs.collections.impl.map.immutable.primitive.ImmutableIntObjectHashMap Maven / Gradle / Ivy

/*
 * Copyright 2014 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.impl.map.immutable.primitive;

import java.io.Serializable;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;

import com.gs.collections.api.IntIterable;
import com.gs.collections.api.LazyIntIterable;
import com.gs.collections.api.LazyIterable;
import com.gs.collections.api.RichIterable;
import com.gs.collections.api.bag.MutableBag;
import com.gs.collections.api.block.function.Function;
import com.gs.collections.api.block.function.Function0;
import com.gs.collections.api.block.function.Function2;
import com.gs.collections.api.block.function.primitive.BooleanFunction;
import com.gs.collections.api.block.function.primitive.ByteFunction;
import com.gs.collections.api.block.function.primitive.CharFunction;
import com.gs.collections.api.block.function.primitive.DoubleFunction;
import com.gs.collections.api.block.function.primitive.DoubleObjectToDoubleFunction;
import com.gs.collections.api.block.function.primitive.FloatFunction;
import com.gs.collections.api.block.function.primitive.FloatObjectToFloatFunction;
import com.gs.collections.api.block.function.primitive.IntFunction;
import com.gs.collections.api.block.function.primitive.IntObjectToIntFunction;
import com.gs.collections.api.block.function.primitive.LongFunction;
import com.gs.collections.api.block.function.primitive.LongObjectToLongFunction;
import com.gs.collections.api.block.function.primitive.ShortFunction;
import com.gs.collections.api.block.predicate.Predicate;
import com.gs.collections.api.block.predicate.Predicate2;
import com.gs.collections.api.block.predicate.primitive.IntObjectPredicate;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.block.procedure.Procedure2;
import com.gs.collections.api.block.procedure.primitive.IntObjectProcedure;
import com.gs.collections.api.block.procedure.primitive.IntProcedure;
import com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure;
import com.gs.collections.api.collection.ImmutableCollection;
import com.gs.collections.api.collection.primitive.ImmutableBooleanCollection;
import com.gs.collections.api.collection.primitive.ImmutableByteCollection;
import com.gs.collections.api.collection.primitive.ImmutableCharCollection;
import com.gs.collections.api.collection.primitive.ImmutableDoubleCollection;
import com.gs.collections.api.collection.primitive.ImmutableFloatCollection;
import com.gs.collections.api.collection.primitive.ImmutableIntCollection;
import com.gs.collections.api.collection.primitive.ImmutableLongCollection;
import com.gs.collections.api.collection.primitive.ImmutableShortCollection;
import com.gs.collections.api.iterator.IntIterator;
import com.gs.collections.api.list.MutableList;
import com.gs.collections.api.map.MapIterable;
import com.gs.collections.api.map.MutableMap;
import com.gs.collections.api.map.primitive.IntObjectMap;
import com.gs.collections.api.map.primitive.ImmutableIntObjectMap;
import com.gs.collections.api.map.primitive.MutableIntObjectMap;
import com.gs.collections.api.map.sorted.MutableSortedMap;
import com.gs.collections.api.multimap.Multimap;
import com.gs.collections.api.multimap.MutableMultimap;
import com.gs.collections.api.partition.PartitionIterable;
import com.gs.collections.api.set.MutableSet;
import com.gs.collections.api.set.primitive.MutableIntSet;
import com.gs.collections.api.set.sorted.MutableSortedSet;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.api.tuple.primitive.IntObjectPair;
import com.gs.collections.impl.UnmodifiableIteratorAdapter;
import com.gs.collections.impl.collection.mutable.UnmodifiableMutableCollection;
import com.gs.collections.impl.map.mutable.primitive.IntObjectHashMap;
import com.gs.collections.api.collection.primitive.MutableBooleanCollection;
import com.gs.collections.api.collection.primitive.MutableByteCollection;
import com.gs.collections.api.collection.primitive.MutableCharCollection;
import com.gs.collections.api.collection.primitive.MutableDoubleCollection;
import com.gs.collections.api.collection.primitive.MutableFloatCollection;
import com.gs.collections.api.collection.primitive.MutableIntCollection;
import com.gs.collections.api.collection.primitive.MutableLongCollection;
import com.gs.collections.api.collection.primitive.MutableShortCollection;
import com.gs.collections.impl.set.mutable.primitive.UnmodifiableIntSet;

/**
 * ImmutableIntObjectHashMap is the non-modifiable equivalent of {@link IntObjectHashMap}.
 * This file was automatically generated from template file immutablePrimitiveObjectHashMap.stg.
 *
 * @since 4.0.
 */
final class ImmutableIntObjectHashMap extends AbstractImmutableIntObjectMap implements Serializable
{
    private static final long serialVersionUID = 1L;
    private final MutableIntObjectMap delegate;

    ImmutableIntObjectHashMap(IntObjectMap delegate)
    {
        this.delegate = new IntObjectHashMap(delegate);
    }

    public V get(int key)
    {
        return this.delegate.get(key);
    }

    public V getIfAbsent(int key, Function0 ifAbsent)
    {
        return this.delegate.getIfAbsent(key, ifAbsent);
    }

    public boolean containsKey(int key)
    {
        return this.delegate.containsKey(key);
    }

    public boolean containsValue(Object value)
    {
        return this.delegate.containsValue(value);
    }

    public void forEachValue(Procedure procedure)
    {
        this.delegate.forEachValue(procedure);
    }

    public void forEachKey(IntProcedure procedure)
    {
        this.delegate.forEachKey(procedure);
    }

    public void forEachKeyValue(IntObjectProcedure procedure)
    {
        this.delegate.forEachKeyValue(procedure);
    }

    public ImmutableIntObjectMap select(IntObjectPredicate predicate)
    {
        return this.delegate.select(predicate).toImmutable();
    }

    public ImmutableIntObjectMap reject(IntObjectPredicate predicate)
    {
        return this.delegate.reject(predicate).toImmutable();
    }

    public ImmutableIntObjectMap toImmutable()
    {
        return this;
    }

    public int size()
    {
        return this.delegate.size();
    }

    public boolean isEmpty()
    {
        return this.delegate.isEmpty();
    }

    public boolean notEmpty()
    {
        return this.delegate.notEmpty();
    }

    public V getFirst()
    {
        return this.delegate.getFirst();
    }

    public V getLast()
    {
        return this.delegate.getLast();
    }

    public boolean contains(Object object)
    {
        return this.delegate.contains(object);
    }

    public boolean containsAllIterable(Iterable source)
    {
        return this.delegate.containsAllIterable(source);
    }

    public boolean containsAll(Collection source)
    {
        return this.delegate.containsAll(source);
    }

    public boolean containsAllArguments(Object... elements)
    {
        return this.delegate.containsAllArguments(elements);
    }

    public ImmutableCollection select(Predicate predicate)
    {
        return this.delegate.select(predicate).toImmutable();
    }

    public > R select(Predicate predicate, R target)
    {
        return this.delegate.select(predicate, target);
    }

    public 

ImmutableCollection selectWith(Predicate2 predicate, P parameter) { return this.delegate.selectWith(predicate, parameter).toImmutable(); } public > R selectWith(Predicate2 predicate, P parameter, R targetCollection) { return this.delegate.selectWith(predicate, parameter, targetCollection); } public ImmutableCollection reject(Predicate predicate) { return this.delegate.reject(predicate).toImmutable(); } public > R reject(Predicate predicate, R target) { return this.delegate.reject(predicate, target); } public

ImmutableCollection rejectWith(Predicate2 predicate, P parameter) { return this.delegate.rejectWith(predicate, parameter).toImmutable(); } public > R rejectWith(Predicate2 predicate, P parameter, R targetCollection) { return this.delegate.rejectWith(predicate, parameter, targetCollection); } public PartitionIterable partition(Predicate predicate) { return this.delegate.partition(predicate); } public

PartitionIterable partitionWith(Predicate2 predicate, P parameter) { return this.delegate.partitionWith(predicate, parameter); } public RichIterable selectInstancesOf(Class clazz) { return this.delegate.selectInstancesOf(clazz); } public ImmutableCollection collect(Function function) { return this.delegate.collect(function).toImmutable(); } public ImmutableBooleanCollection collectBoolean(BooleanFunction booleanFunction) { return this.delegate.collectBoolean(booleanFunction).toImmutable(); } public R collectBoolean(BooleanFunction booleanFunction, R target) { return this.delegate.collectBoolean(booleanFunction, target); } public ImmutableByteCollection collectByte(ByteFunction byteFunction) { return this.delegate.collectByte(byteFunction).toImmutable(); } public R collectByte(ByteFunction byteFunction, R target) { return this.delegate.collectByte(byteFunction, target); } public ImmutableCharCollection collectChar(CharFunction charFunction) { return this.delegate.collectChar(charFunction).toImmutable(); } public R collectChar(CharFunction charFunction, R target) { return this.delegate.collectChar(charFunction, target); } public ImmutableDoubleCollection collectDouble(DoubleFunction doubleFunction) { return this.delegate.collectDouble(doubleFunction).toImmutable(); } public R collectDouble(DoubleFunction doubleFunction, R target) { return this.delegate.collectDouble(doubleFunction, target); } public ImmutableFloatCollection collectFloat(FloatFunction floatFunction) { return this.delegate.collectFloat(floatFunction).toImmutable(); } public R collectFloat(FloatFunction floatFunction, R target) { return this.delegate.collectFloat(floatFunction, target); } public ImmutableIntCollection collectInt(IntFunction intFunction) { return this.delegate.collectInt(intFunction).toImmutable(); } public R collectInt(IntFunction intFunction, R target) { return this.delegate.collectInt(intFunction, target); } public ImmutableLongCollection collectLong(LongFunction longFunction) { return this.delegate.collectLong(longFunction).toImmutable(); } public R collectLong(LongFunction longFunction, R target) { return this.delegate.collectLong(longFunction, target); } public ImmutableShortCollection collectShort(ShortFunction shortFunction) { return this.delegate.collectShort(shortFunction).toImmutable(); } public R collectShort(ShortFunction shortFunction, R target) { return this.delegate.collectShort(shortFunction, target); } public ImmutableCollection collectWith(Function2 function, P parameter) { return this.delegate.collectWith(function, parameter).toImmutable(); } public RichIterable collectIf(Predicate predicate, Function function) { return this.delegate.collectIf(predicate, function); } public RichIterable flatCollect(Function> function) { return this.delegate.flatCollect(function); } public V detect(Predicate predicate) { return this.delegate.detect(predicate); } public

V detectWith(Predicate2 predicate, P parameter) { return this.delegate.detectWith(predicate, parameter); } public V detectIfNone(Predicate predicate, Function0 function) { return this.delegate.detectIfNone(predicate, function); } public

V detectWithIfNone(Predicate2 predicate, P parameter, Function0 function) { return this.delegate.detectWithIfNone(predicate, parameter, function); } public int count(Predicate predicate) { return this.delegate.count(predicate); } public

int countWith(Predicate2 predicate, P parameter) { return this.delegate.countWith(predicate, parameter); } public boolean anySatisfy(Predicate predicate) { return this.delegate.anySatisfy(predicate); } public

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

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

boolean noneSatisfyWith(Predicate2 predicate, P parameter) { return this.delegate.noneSatisfyWith(predicate, parameter); } public IV injectInto(IV injectedValue, Function2 function) { return this.delegate.injectInto(injectedValue, function); } public int injectInto(int injectedValue, IntObjectToIntFunction function) { return this.delegate.injectInto(injectedValue, function); } public long injectInto(long injectedValue, LongObjectToLongFunction function) { return this.delegate.injectInto(injectedValue, function); } public float injectInto(float injectedValue, FloatObjectToFloatFunction function) { return this.delegate.injectInto(injectedValue, function); } public double injectInto(double injectedValue, DoubleObjectToDoubleFunction function) { return this.delegate.injectInto(injectedValue, function); } public MutableList toList() { return this.delegate.toList(); } public MutableList toSortedList() { return this.delegate.toSortedList(); } public MutableList toSortedList(Comparator comparator) { return this.delegate.toSortedList(comparator); } public MutableSet toSet() { return this.delegate.toSet(); } public MutableSortedSet toSortedSet() { return this.delegate.toSortedSet(); } public MutableSortedSet toSortedSet(Comparator comparator) { return this.delegate.toSortedSet(comparator); } public MutableBag toBag() { return this.delegate.toBag(); } public MutableMap toMap(Function keyFunction, Function valueFunction) { return this.delegate.toMap(keyFunction, valueFunction); } public MutableSortedMap toSortedMap(Function keyFunction, Function valueFunction) { return this.delegate.toSortedMap(keyFunction, valueFunction); } public MutableSortedMap toSortedMap(Comparator comparator, Function keyFunction, Function valueFunction) { return this.delegate.toSortedMap(comparator, keyFunction, valueFunction); } public LazyIterable asLazy() { return this.delegate.asLazy(); } public Object[] toArray() { return this.delegate.toArray(); } public T[] toArray(T[] a) { return this.delegate.toArray(a); } public V min(Comparator comparator) { return this.delegate.min(comparator); } public V max(Comparator comparator) { return this.delegate.max(comparator); } public V min() { return this.delegate.min(); } public V max() { return this.delegate.max(); } public long sumOfInt(IntFunction function) { return this.delegate.sumOfInt(function); } public double sumOfFloat(FloatFunction function) { return this.delegate.sumOfFloat(function); } public long sumOfLong(LongFunction function) { return this.delegate.sumOfLong(function); } public double sumOfDouble(DoubleFunction function) { return this.delegate.sumOfDouble(function); } public String makeString() { return this.delegate.makeString(); } public String makeString(String separator) { return this.delegate.makeString(separator); } public String makeString(String start, String separator, String end) { return this.delegate.makeString(start, separator, end); } public void appendString(Appendable appendable) { this.delegate.appendString(appendable); } public void appendString(Appendable appendable, String separator) { this.delegate.appendString(appendable, separator); } public void appendString(Appendable appendable, String start, String separator, String end) { this.delegate.appendString(appendable, start, separator, end); } public Multimap groupBy(Function function) { return this.delegate.groupBy(function); } public Multimap groupByEach(Function> function) { return this.delegate.groupByEach(function); } public RichIterable> zip(Iterable that) { return this.delegate.zip(that); } public >> R zip(Iterable that, R target) { return this.delegate.zip(that, target); } public RichIterable> zipWithIndex() { return this.delegate.zipWithIndex(); } public >> R zipWithIndex(R target) { return this.delegate.zipWithIndex(target); } public RichIterable> chunk(int size) { return this.delegate.chunk(size); } public MapIterable aggregateInPlaceBy(Function groupBy, Function0 zeroValueFactory, Procedure2 mutatingAggregator) { return this.delegate.aggregateInPlaceBy(groupBy, zeroValueFactory, mutatingAggregator); } public MapIterable aggregateBy(Function groupBy, Function0 zeroValueFactory, Function2 nonMutatingAggregator) { return this.delegate.aggregateBy(groupBy, zeroValueFactory, nonMutatingAggregator); } public > R groupByEach(Function> function, R target) { return this.delegate.groupByEach(function, target); } public > R groupBy(Function function, R target) { return this.delegate.groupBy(function, target); } public MapIterable groupByUniqueKey(Function function) { throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".groupByUniqueKey() not implemented yet"); } public > V maxBy(Function function) { return this.delegate.maxBy(function); } public > V minBy(Function function) { return this.delegate.minBy(function); } public > MutableSortedSet toSortedSetBy(Function function) { return this.delegate.toSortedSetBy(function); } public > MutableList toSortedListBy(Function function) { return this.delegate.toSortedListBy(function); } public > R flatCollect(Function> function, R target) { return this.delegate.flatCollect(function, target); } public > R collectIf(Predicate predicate, Function function, R target) { return this.delegate.collectIf(predicate, function, target); } public > R collectWith(Function2 function, P parameter, R targetCollection) { return this.delegate.collectWith(function, parameter, targetCollection); } public > R collect(Function function, R target) { return this.delegate.collect(function, target); } public ImmutableIntObjectMap newWithKeyValue(int key, V value) { IntObjectHashMap map = new IntObjectHashMap(this); map.put(key, value); return map.toImmutable(); } public ImmutableIntObjectMap newWithoutKey(int key) { IntObjectHashMap map = new IntObjectHashMap(this); map.removeKey(key); return map.toImmutable(); } public ImmutableIntObjectMap newWithoutAllKeys(IntIterable keys) { IntObjectHashMap map = new IntObjectHashMap(this); IntIterator iterator = keys.intIterator(); while (iterator.hasNext()) { map.removeKey(iterator.next()); } return map.toImmutable(); } public void forEach(Procedure procedure) { this.delegate.forEach(procedure); } public void forEachWithIndex(ObjectIntProcedure objectIntProcedure) { this.delegate.forEachWithIndex(objectIntProcedure); } public

void forEachWith(Procedure2 procedure, P parameter) { this.delegate.forEachWith(procedure, parameter); } public Iterator iterator() { return new UnmodifiableIteratorAdapter(this.delegate.iterator()); } public MutableIntSet keySet() { return UnmodifiableIntSet.of(this.delegate.keySet()); } public Collection values() { return UnmodifiableMutableCollection.of(this.delegate.values()); } public LazyIntIterable keysView() { return this.delegate.keysView(); } public RichIterable> keyValuesView() { return this.delegate.keyValuesView(); } @Override public boolean equals(Object obj) { return this.delegate.equals(obj); } @Override public int hashCode() { return this.delegate.hashCode(); } @Override public String toString() { return this.delegate.toString(); } private Object writeReplace() { return new ImmutableIntObjectMapSerializationProxy(this); } }