com.gs.collections.impl.map.immutable.primitive.ImmutableByteObjectHashMap Maven / Gradle / Ivy
Show all versions of gs-collections Show documentation
/*
* 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.ByteIterable;
import com.gs.collections.api.LazyByteIterable;
import com.gs.collections.api.LazyIterable;
import com.gs.collections.api.RichIterable;
import com.gs.collections.api.bag.MutableBag;
import com.gs.collections.api.bag.sorted.MutableSortedBag;
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.ByteObjectPredicate;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.block.procedure.Procedure2;
import com.gs.collections.api.block.procedure.primitive.ByteObjectProcedure;
import com.gs.collections.api.block.procedure.primitive.ByteProcedure;
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.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.api.iterator.ByteIterator;
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.ByteObjectMap;
import com.gs.collections.api.map.primitive.ImmutableByteObjectMap;
import com.gs.collections.api.map.primitive.MutableByteObjectMap;
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.MutableByteSet;
import com.gs.collections.api.set.sorted.MutableSortedSet;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.api.tuple.primitive.ByteObjectPair;
import com.gs.collections.impl.UnmodifiableIteratorAdapter;
import com.gs.collections.impl.collection.mutable.UnmodifiableMutableCollection;
import com.gs.collections.impl.map.mutable.primitive.ByteObjectHashMap;
import com.gs.collections.impl.set.mutable.primitive.UnmodifiableByteSet;
/**
* ImmutableByteObjectHashMap is the non-modifiable equivalent of {@link ByteObjectHashMap}.
* This file was automatically generated from template file immutablePrimitiveObjectHashMap.stg.
*
* @since 4.0.
*/
final class ImmutableByteObjectHashMap extends AbstractImmutableByteObjectMap implements Serializable
{
private static final long serialVersionUID = 1L;
private final MutableByteObjectMap delegate;
ImmutableByteObjectHashMap(ByteObjectMap extends V> delegate)
{
this.delegate = new ByteObjectHashMap(delegate);
}
public V get(byte key)
{
return this.delegate.get(key);
}
public V getIfAbsent(byte key, Function0 extends V> ifAbsent)
{
return this.delegate.getIfAbsent(key, ifAbsent);
}
public boolean containsKey(byte key)
{
return this.delegate.containsKey(key);
}
public boolean containsValue(Object value)
{
return this.delegate.containsValue(value);
}
public ImmutableByteObjectMap tap(Procedure super V> procedure)
{
this.forEach(procedure);
return this;
}
public void forEachValue(Procedure super V> procedure)
{
this.delegate.forEachValue(procedure);
}
public void forEachKey(ByteProcedure procedure)
{
this.delegate.forEachKey(procedure);
}
public void forEachKeyValue(ByteObjectProcedure super V> procedure)
{
this.delegate.forEachKeyValue(procedure);
}
public ImmutableByteObjectMap select(ByteObjectPredicate super V> predicate)
{
return this.delegate.select(predicate).toImmutable();
}
public ImmutableByteObjectMap reject(ByteObjectPredicate super V> predicate)
{
return this.delegate.reject(predicate).toImmutable();
}
public ImmutableByteObjectMap 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 super V> predicate)
{
return this.delegate.select(predicate).toImmutable();
}
public > R select(Predicate super V> predicate, R target)
{
return this.delegate.select(predicate, target);
}
public ImmutableCollection selectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.selectWith(predicate, parameter).toImmutable();
}
public > R selectWith(Predicate2 super V, ? super P> predicate, P parameter, R targetCollection)
{
return this.delegate.selectWith(predicate, parameter, targetCollection);
}
public ImmutableCollection reject(Predicate super V> predicate)
{
return this.delegate.reject(predicate).toImmutable();
}
public > R reject(Predicate super V> predicate, R target)
{
return this.delegate.reject(predicate, target);
}
public ImmutableCollection rejectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.rejectWith(predicate, parameter).toImmutable();
}
public > R rejectWith(Predicate2 super V, ? super P> predicate, P parameter, R targetCollection)
{
return this.delegate.rejectWith(predicate, parameter, targetCollection);
}
public PartitionIterable partition(Predicate super V> predicate)
{
return this.delegate.partition(predicate);
}
public PartitionIterable partitionWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.partitionWith(predicate, parameter);
}
public RichIterable selectInstancesOf(Class clazz)
{
return this.delegate.selectInstancesOf(clazz);
}
public ImmutableCollection collect(Function super V, ? extends VV> function)
{
return this.delegate.collect(function).toImmutable();
}
public ImmutableBooleanCollection collectBoolean(BooleanFunction super V> booleanFunction)
{
return this.delegate.collectBoolean(booleanFunction).toImmutable();
}
public R collectBoolean(BooleanFunction super V> booleanFunction, R target)
{
return this.delegate.collectBoolean(booleanFunction, target);
}
public ImmutableByteCollection collectByte(ByteFunction super V> byteFunction)
{
return this.delegate.collectByte(byteFunction).toImmutable();
}
public R collectByte(ByteFunction super V> byteFunction, R target)
{
return this.delegate.collectByte(byteFunction, target);
}
public ImmutableCharCollection collectChar(CharFunction super V> charFunction)
{
return this.delegate.collectChar(charFunction).toImmutable();
}
public R collectChar(CharFunction super V> charFunction, R target)
{
return this.delegate.collectChar(charFunction, target);
}
public ImmutableDoubleCollection collectDouble(DoubleFunction super V> doubleFunction)
{
return this.delegate.collectDouble(doubleFunction).toImmutable();
}
public R collectDouble(DoubleFunction super V> doubleFunction, R target)
{
return this.delegate.collectDouble(doubleFunction, target);
}
public ImmutableFloatCollection collectFloat(FloatFunction super V> floatFunction)
{
return this.delegate.collectFloat(floatFunction).toImmutable();
}
public R collectFloat(FloatFunction super V> floatFunction, R target)
{
return this.delegate.collectFloat(floatFunction, target);
}
public ImmutableIntCollection collectInt(IntFunction super V> intFunction)
{
return this.delegate.collectInt(intFunction).toImmutable();
}
public R collectInt(IntFunction super V> intFunction, R target)
{
return this.delegate.collectInt(intFunction, target);
}
public ImmutableLongCollection collectLong(LongFunction super V> longFunction)
{
return this.delegate.collectLong(longFunction).toImmutable();
}
public R collectLong(LongFunction super V> longFunction, R target)
{
return this.delegate.collectLong(longFunction, target);
}
public ImmutableShortCollection collectShort(ShortFunction super V> shortFunction)
{
return this.delegate.collectShort(shortFunction).toImmutable();
}
public R collectShort(ShortFunction super V> shortFunction, R target)
{
return this.delegate.collectShort(shortFunction, target);
}
public ImmutableCollection collectWith(Function2 super V, ? super P, ? extends VV> function, P parameter)
{
return this.delegate.collectWith(function, parameter).toImmutable();
}
public RichIterable collectIf(Predicate super V> predicate, Function super V, ? extends VV> function)
{
return this.delegate.collectIf(predicate, function);
}
public RichIterable flatCollect(Function super V, ? extends Iterable> function)
{
return this.delegate.flatCollect(function);
}
public V detect(Predicate super V> predicate)
{
return this.delegate.detect(predicate);
}
public V detectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.detectWith(predicate, parameter);
}
public V detectIfNone(Predicate super V> predicate, Function0 extends V> function)
{
return this.delegate.detectIfNone(predicate, function);
}
public
V detectWithIfNone(Predicate2 super V, ? super P> predicate, P parameter, Function0 extends V> function)
{
return this.delegate.detectWithIfNone(predicate, parameter, function);
}
public int count(Predicate super V> predicate)
{
return this.delegate.count(predicate);
}
public
int countWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.countWith(predicate, parameter);
}
public boolean anySatisfy(Predicate super V> predicate)
{
return this.delegate.anySatisfy(predicate);
}
public
boolean anySatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.anySatisfyWith(predicate, parameter);
}
public boolean allSatisfy(Predicate super V> predicate)
{
return this.delegate.allSatisfy(predicate);
}
public
boolean allSatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.allSatisfyWith(predicate, parameter);
}
public boolean noneSatisfy(Predicate super V> predicate)
{
return this.delegate.noneSatisfy(predicate);
}
public
boolean noneSatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.delegate.noneSatisfyWith(predicate, parameter);
}
public IV injectInto(IV injectedValue, Function2 super IV, ? super V, ? extends IV> function)
{
return this.delegate.injectInto(injectedValue, function);
}
public int injectInto(int injectedValue, IntObjectToIntFunction super V> function)
{
return this.delegate.injectInto(injectedValue, function);
}
public long injectInto(long injectedValue, LongObjectToLongFunction super V> function)
{
return this.delegate.injectInto(injectedValue, function);
}
public float injectInto(float injectedValue, FloatObjectToFloatFunction super V> function)
{
return this.delegate.injectInto(injectedValue, function);
}
public double injectInto(double injectedValue, DoubleObjectToDoubleFunction super V> 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 super V> comparator)
{
return this.delegate.toSortedList(comparator);
}
public MutableSet toSet()
{
return this.delegate.toSet();
}
public MutableSortedSet toSortedSet()
{
return this.delegate.toSortedSet();
}
public MutableSortedSet toSortedSet(Comparator super V> comparator)
{
return this.delegate.toSortedSet(comparator);
}
public MutableBag toBag()
{
return this.delegate.toBag();
}
public MutableSortedBag toSortedBag()
{
return this.delegate.toSortedBag();
}
public MutableSortedBag toSortedBag(Comparator super V> comparator)
{
return this.delegate.toSortedBag(comparator);
}
public > MutableSortedBag toSortedBagBy(Function super V, ? extends VV> function)
{
return this.delegate.toSortedBagBy(function);
}
public MutableMap toMap(Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return this.delegate.toMap(keyFunction, valueFunction);
}
public MutableSortedMap toSortedMap(Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return this.delegate.toSortedMap(keyFunction, valueFunction);
}
public MutableSortedMap toSortedMap(Comparator super NK> comparator, Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> 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 super V> comparator)
{
return this.delegate.min(comparator);
}
public V max(Comparator super V> comparator)
{
return this.delegate.max(comparator);
}
public V min()
{
return this.delegate.min();
}
public V max()
{
return this.delegate.max();
}
public long sumOfInt(IntFunction super V> function)
{
return this.delegate.sumOfInt(function);
}
public double sumOfFloat(FloatFunction super V> function)
{
return this.delegate.sumOfFloat(function);
}
public long sumOfLong(LongFunction super V> function)
{
return this.delegate.sumOfLong(function);
}
public double sumOfDouble(DoubleFunction super V> 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 super V, ? extends VV> function)
{
return this.delegate.groupBy(function);
}
public > R groupBy(Function super V, ? extends VV> function, R target)
{
return this.delegate.groupBy(function, target);
}
public Multimap groupByEach(Function super V, ? extends Iterable> function)
{
return this.delegate.groupByEach(function);
}
public > R groupByEach(Function super V, ? extends Iterable> function, R target)
{
return this.delegate.groupByEach(function, target);
}
public MapIterable groupByUniqueKey(Function super V, ? extends VV> function)
{
return this.delegate.groupByUniqueKey(function);
}
public > R groupByUniqueKey(Function super V, ? extends VV> function, R target)
{
return this.delegate.groupByUniqueKey(function, target);
}
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 super V, ? extends K> groupBy, Function0 extends VV> zeroValueFactory, Procedure2 super VV, ? super V> mutatingAggregator)
{
return this.delegate.aggregateInPlaceBy(groupBy, zeroValueFactory, mutatingAggregator);
}
public MapIterable aggregateBy(Function super V, ? extends K> groupBy, Function0 extends VV> zeroValueFactory, Function2 super VV, ? super V, ? extends VV> nonMutatingAggregator)
{
return this.delegate.aggregateBy(groupBy, zeroValueFactory, nonMutatingAggregator);
}
public > V maxBy(Function super V, ? extends VV> function)
{
return this.delegate.maxBy(function);
}
public > V minBy(Function super V, ? extends VV> function)
{
return this.delegate.minBy(function);
}
public > MutableSortedSet toSortedSetBy(Function super V, ? extends VV> function)
{
return this.delegate.toSortedSetBy(function);
}
public > MutableList toSortedListBy(Function super V, ? extends VV> function)
{
return this.delegate.toSortedListBy(function);
}
public > R flatCollect(Function super V, ? extends Iterable> function, R target)
{
return this.delegate.flatCollect(function, target);
}
public > R collectIf(Predicate super V> predicate, Function super V, ? extends VV> function, R target)
{
return this.delegate.collectIf(predicate, function, target);
}
public > R collectWith(Function2 super V, ? super P, ? extends VV> function, P parameter, R targetCollection)
{
return this.delegate.collectWith(function, parameter, targetCollection);
}
public > R collect(Function super V, ? extends VV> function, R target)
{
return this.delegate.collect(function, target);
}
public ImmutableByteObjectMap newWithKeyValue(byte key, V value)
{
ByteObjectHashMap map = new ByteObjectHashMap(this);
map.put(key, value);
return map.toImmutable();
}
public ImmutableByteObjectMap newWithoutKey(byte key)
{
ByteObjectHashMap map = new ByteObjectHashMap(this);
map.removeKey(key);
return map.toImmutable();
}
public ImmutableByteObjectMap newWithoutAllKeys(ByteIterable keys)
{
ByteObjectHashMap map = new ByteObjectHashMap(this);
ByteIterator iterator = keys.byteIterator();
while (iterator.hasNext())
{
map.removeKey(iterator.next());
}
return map.toImmutable();
}
public void forEach(Procedure super V> procedure)
{
this.each(procedure);
}
public void each(Procedure super V> procedure)
{
this.delegate.forEach(procedure);
}
public void forEachWithIndex(ObjectIntProcedure super V> objectIntProcedure)
{
this.delegate.forEachWithIndex(objectIntProcedure);
}
public void forEachWith(Procedure2 super V, ? super P> procedure, P parameter)
{
this.delegate.forEachWith(procedure, parameter);
}
public Iterator iterator()
{
return new UnmodifiableIteratorAdapter(this.delegate.iterator());
}
public MutableByteSet keySet()
{
return UnmodifiableByteSet.of(this.delegate.keySet());
}
public Collection values()
{
return UnmodifiableMutableCollection.of(this.delegate.values());
}
public LazyByteIterable 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 ImmutableByteObjectMapSerializationProxy(this);
}
}