com.gs.collections.impl.map.mutable.primitive.UnmodifiableLongObjectMap 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.mutable.primitive;
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import com.gs.collections.api.LongIterable;
import com.gs.collections.api.LazyLongIterable;
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.LongToObjectFunction;
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.LongObjectPredicate;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.block.procedure.Procedure2;
import com.gs.collections.api.block.procedure.primitive.LongObjectProcedure;
import com.gs.collections.api.block.procedure.primitive.LongProcedure;
import com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure;
import com.gs.collections.api.collection.MutableCollection;
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.list.MutableList;
import com.gs.collections.api.map.MutableMap;
import com.gs.collections.api.map.primitive.ImmutableLongObjectMap;
import com.gs.collections.api.map.primitive.MutableLongObjectMap;
import com.gs.collections.api.map.sorted.MutableSortedMap;
import com.gs.collections.api.multimap.MutableMultimap;
import com.gs.collections.api.map.primitive.LongObjectMap;
import com.gs.collections.api.partition.PartitionMutableCollection;
import com.gs.collections.api.set.MutableSet;
import com.gs.collections.api.set.primitive.MutableLongSet;
import com.gs.collections.api.set.sorted.MutableSortedSet;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.api.tuple.primitive.LongObjectPair;
import com.gs.collections.impl.UnmodifiableIteratorAdapter;
import com.gs.collections.impl.factory.primitive.LongObjectMaps;
import com.gs.collections.impl.set.mutable.primitive.UnmodifiableLongSet;
/**
* This file was automatically generated from template file unmodifiablePrimitiveObjectMap.stg.
*
* @since 3.2.
*/
public final class UnmodifiableLongObjectMap
implements MutableLongObjectMap, Serializable
{
private static final long serialVersionUID = 1L;
private final MutableLongObjectMap map;
UnmodifiableLongObjectMap(MutableLongObjectMap map)
{
this.map = map;
}
private boolean isAbsent(V result, long key)
{
return result == null && !this.containsKey(key);
}
private V getIfAbsentThrow(long key)
{
V result = this.map.get(key);
if (this.isAbsent(result, key))
{
throw new UnsupportedOperationException("Cannot add to an " + this.getClass().getSimpleName());
}
return result;
}
public V put(long key, V value)
{
throw new UnsupportedOperationException("Cannot call put() on " + this.getClass().getSimpleName());
}
public void putAll(LongObjectMap extends V> map)
{
throw new UnsupportedOperationException("Cannot call putAll() on " + this.getClass().getSimpleName());
}
public V removeKey(long key)
{
throw new UnsupportedOperationException("Cannot call removeKey() on " + this.getClass().getSimpleName());
}
public V remove(long key)
{
throw new UnsupportedOperationException("Cannot call remove() on " + this.getClass().getSimpleName());
}
public V getIfAbsentPut(long key, Function0 extends V> function)
{
return this.getIfAbsentThrow(key);
}
public V getIfAbsentPut(long key, V value)
{
return this.getIfAbsentThrow(key);
}
public V getIfAbsentPutWithKey(long key, LongToObjectFunction extends V> function)
{
return this.getIfAbsentThrow(key);
}
public V getIfAbsentPutWith(long key, Function super P, ? extends V> function, P parameter)
{
return this.getIfAbsentThrow(key);
}
public V updateValue(long key, Function0 extends V> factory, Function super V, ? extends V> function)
{
throw new UnsupportedOperationException("Cannot call updateValue() on " + this.getClass().getSimpleName());
}
public
V updateValueWith(long key, Function0 extends V> factory, Function2 super V, ? super P, ? extends V> function, P parameter)
{
throw new UnsupportedOperationException("Cannot call updateValueWith() on " + this.getClass().getSimpleName());
}
public V get(long key)
{
return this.map.get(key);
}
public V getIfAbsent(long key, Function0 extends V> ifAbsent)
{
return this.map.getIfAbsent(key, ifAbsent);
}
public boolean containsKey(long key)
{
return this.map.containsKey(key);
}
public boolean containsValue(Object value)
{
return this.map.containsValue(value);
}
public void forEachValue(Procedure super V> procedure)
{
this.map.forEachValue(procedure);
}
public void forEachKey(LongProcedure procedure)
{
this.map.forEachKey(procedure);
}
public void forEachKeyValue(LongObjectProcedure super V> procedure)
{
this.map.forEachKeyValue(procedure);
}
public MutableLongObjectMap select(LongObjectPredicate super V> predicate)
{
return this.map.select(predicate);
}
public MutableLongObjectMap reject(LongObjectPredicate super V> predicate)
{
return this.map.reject(predicate);
}
public int size()
{
return this.map.size();
}
public boolean isEmpty()
{
return this.map.isEmpty();
}
public boolean notEmpty()
{
return this.map.notEmpty();
}
public V getFirst()
{
return this.map.getFirst();
}
public V getLast()
{
return this.map.getLast();
}
public boolean contains(Object object)
{
return this.map.contains(object);
}
public boolean containsAllIterable(Iterable> source)
{
return this.map.containsAllIterable(source);
}
public boolean containsAll(Collection> source)
{
return this.map.containsAll(source);
}
public boolean containsAllArguments(Object... elements)
{
return this.map.containsAllArguments(elements);
}
public MutableCollection select(Predicate super V> predicate)
{
return this.map.select(predicate);
}
public > R select(Predicate super V> predicate, R target)
{
return this.map.select(predicate, target);
}
public MutableCollection selectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.selectWith(predicate, parameter);
}
public > R selectWith(Predicate2 super V, ? super P> predicate, P parameter, R targetCollection)
{
return this.map.selectWith(predicate, parameter, targetCollection);
}
public PartitionMutableCollection partition(Predicate super V> predicate)
{
return this.map.partition(predicate);
}
public PartitionMutableCollection partitionWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.partitionWith(predicate, parameter);
}
public MutableCollection selectInstancesOf(Class clazz)
{
return (MutableCollection) this.map.selectInstancesOf(clazz);
}
public MutableList> zipWithIndex()
{
return (MutableList>) this.map.zipWithIndex();
}
public >> R zipWithIndex(R target)
{
return this.map.zipWithIndex(target);
}
public RichIterable> chunk(int size)
{
return this.map.chunk(size);
}
public MutableMap aggregateInPlaceBy(Function super V, ? extends K> groupBy, Function0 extends VV> zeroValueFactory, Procedure2 super VV, ? super V> mutatingAggregator)
{
return (MutableMap) this.map.aggregateInPlaceBy(groupBy, zeroValueFactory, mutatingAggregator);
}
public MutableMap aggregateBy(Function super V, ? extends K> groupBy, Function0 extends VV> zeroValueFactory, Function2 super VV, ? super V, ? extends VV> nonMutatingAggregator)
{
return (MutableMap) this.map.aggregateBy(groupBy, zeroValueFactory, nonMutatingAggregator);
}
public MutableCollection reject(Predicate super V> predicate)
{
return this.map.reject(predicate);
}
public > R reject(Predicate super V> predicate, R target)
{
return this.map.reject(predicate, target);
}
public MutableCollection rejectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.rejectWith(predicate, parameter);
}
public > R rejectWith(Predicate2 super V, ? super P> predicate, P parameter, R targetCollection)
{
return this.map.rejectWith(predicate, parameter, targetCollection);
}
public void clear()
{
throw new UnsupportedOperationException("Cannot call clear() on " + this.getClass().getSimpleName());
}
public MutableCollection collect(Function super V, ? extends VV> function)
{
return this.map.collect(function);
}
public MutableBooleanCollection collectBoolean(BooleanFunction super V> booleanFunction)
{
return this.map.collectBoolean(booleanFunction);
}
public R collectBoolean(BooleanFunction super V> booleanFunction, R target)
{
return this.map.collectBoolean(booleanFunction, target);
}
public MutableByteCollection collectByte(ByteFunction super V> byteFunction)
{
return this.map.collectByte(byteFunction);
}
public R collectByte(ByteFunction super V> byteFunction, R target)
{
return this.map.collectByte(byteFunction, target);
}
public MutableCharCollection collectChar(CharFunction super V> charFunction)
{
return this.map.collectChar(charFunction);
}
public R collectChar(CharFunction super V> charFunction, R target)
{
return this.map.collectChar(charFunction, target);
}
public MutableDoubleCollection collectDouble(DoubleFunction super V> doubleFunction)
{
return this.map.collectDouble(doubleFunction);
}
public R collectDouble(DoubleFunction super V> doubleFunction, R target)
{
return this.map.collectDouble(doubleFunction, target);
}
public MutableFloatCollection collectFloat(FloatFunction super V> floatFunction)
{
return this.map.collectFloat(floatFunction);
}
public R collectFloat(FloatFunction super V> floatFunction, R target)
{
return this.map.collectFloat(floatFunction, target);
}
public MutableIntCollection collectInt(IntFunction super V> intFunction)
{
return this.map.collectInt(intFunction);
}
public R collectInt(IntFunction super V> intFunction, R target)
{
return this.map.collectInt(intFunction, target);
}
public MutableLongCollection collectLong(LongFunction super V> longFunction)
{
return this.map.collectLong(longFunction);
}
public R collectLong(LongFunction super V> longFunction, R target)
{
return this.map.collectLong(longFunction, target);
}
public MutableShortCollection collectShort(ShortFunction super V> shortFunction)
{
return this.map.collectShort(shortFunction);
}
public R collectShort(ShortFunction super V> shortFunction, R target)
{
return this.map.collectShort(shortFunction, target);
}
public MutableCollection collectWith(Function2 super V, ? super P, ? extends VV> function, P parameter)
{
return this.map.collectWith(function, parameter);
}
public > R collectWith(Function2 super V, ? super P, ? extends VV> function, P parameter, R targetCollection)
{
return this.map.collectWith(function, parameter, targetCollection);
}
public > R collect(Function super V, ? extends VV> function, R target)
{
return this.map.collect(function, target);
}
public MutableCollection collectIf(Predicate super V> predicate, Function super V, ? extends VV> function)
{
return (MutableCollection) this.map.collectIf(predicate, function);
}
public > R collectIf(Predicate super V> predicate, Function super V, ? extends VV> function, R target)
{
return this.map.collectIf(predicate, function, target);
}
public RichIterable flatCollect(Function super V, ? extends Iterable> function)
{
return this.map.flatCollect(function);
}
public > R flatCollect(Function super V, ? extends Iterable> function, R target)
{
return this.map.flatCollect(function, target);
}
public V detect(Predicate super V> predicate)
{
return this.map.detect(predicate);
}
public V detectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.detectWith(predicate, parameter);
}
public V detectIfNone(Predicate super V> predicate, Function0 extends V> function)
{
return this.map.detectIfNone(predicate, function);
}
public
V detectWithIfNone(Predicate2 super V, ? super P> predicate, P parameter, Function0 extends V> function)
{
return this.map.detectWithIfNone(predicate, parameter, function);
}
public int count(Predicate super V> predicate)
{
return this.map.count(predicate);
}
public
int countWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.countWith(predicate, parameter);
}
public boolean anySatisfy(Predicate super V> predicate)
{
return this.map.anySatisfy(predicate);
}
public
boolean anySatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.anySatisfyWith(predicate, parameter);
}
public boolean allSatisfy(Predicate super V> predicate)
{
return this.map.allSatisfy(predicate);
}
public
boolean allSatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.allSatisfyWith(predicate, parameter);
}
public boolean noneSatisfy(Predicate super V> predicate)
{
return this.map.noneSatisfy(predicate);
}
public
boolean noneSatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return this.map.noneSatisfyWith(predicate, parameter);
}
public IV injectInto(IV injectedValue, Function2 super IV, ? super V, ? extends IV> function)
{
return this.map.injectInto(injectedValue, function);
}
public int injectInto(int injectedValue, IntObjectToIntFunction super V> function)
{
return this.map.injectInto(injectedValue, function);
}
public long injectInto(long injectedValue, LongObjectToLongFunction super V> function)
{
return this.map.injectInto(injectedValue, function);
}
public float injectInto(float injectedValue, FloatObjectToFloatFunction super V> function)
{
return this.map.injectInto(injectedValue, function);
}
public double injectInto(double injectedValue, DoubleObjectToDoubleFunction super V> function)
{
return this.map.injectInto(injectedValue, function);
}
public MutableList toList()
{
return this.map.toList();
}
public MutableList toSortedList()
{
return this.map.toSortedList();
}
public MutableList toSortedList(Comparator super V> comparator)
{
return this.map.toSortedList(comparator);
}
public > MutableList toSortedListBy(Function super V, ? extends VV> function)
{
return this.map.toSortedListBy(function);
}
public MutableSet toSet()
{
return this.map.toSet();
}
public MutableSortedSet toSortedSet()
{
return this.map.toSortedSet();
}
public MutableSortedSet toSortedSet(Comparator super V> comparator)
{
return this.map.toSortedSet(comparator);
}
public > MutableSortedSet toSortedSetBy(Function super V, ? extends VV> function)
{
return this.map.toSortedSetBy(function);
}
public MutableBag toBag()
{
return this.map.toBag();
}
public MutableMap toMap(Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return this.map.toMap(keyFunction, valueFunction);
}
public MutableSortedMap toSortedMap(Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return this.map.toSortedMap(keyFunction, valueFunction);
}
public MutableSortedMap toSortedMap(Comparator super NK> comparator, Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return this.map.toSortedMap(comparator, keyFunction, valueFunction);
}
public LazyIterable asLazy()
{
return this.map.asLazy();
}
public Object[] toArray()
{
return this.map.toArray();
}
public T[] toArray(T[] a)
{
return this.map.toArray(a);
}
public V min(Comparator super V> comparator)
{
return this.map.min(comparator);
}
public V max(Comparator super V> comparator)
{
return this.map.max(comparator);
}
public V min()
{
return this.map.min();
}
public V max()
{
return this.map.max();
}
public > V maxBy(Function super V, ? extends VV> function)
{
return this.map.maxBy(function);
}
public > V minBy(Function super V, ? extends VV> function)
{
return this.map.minBy(function);
}
public long sumOfInt(IntFunction super V> function)
{
return this.map.sumOfInt(function);
}
public double sumOfFloat(FloatFunction super V> function)
{
return this.map.sumOfFloat(function);
}
public long sumOfLong(LongFunction super V> function)
{
return this.map.sumOfLong(function);
}
public double sumOfDouble(DoubleFunction super V> function)
{
return this.map.sumOfDouble(function);
}
public MutableLongSet keySet()
{
return UnmodifiableLongSet.of(this.map.keySet());
}
public Collection values()
{
return Collections.unmodifiableCollection(this.map.values());
}
public LazyLongIterable keysView()
{
return this.map.keysView();
}
public RichIterable> keyValuesView()
{
return this.map.keyValuesView();
}
@Override
public boolean equals(Object obj)
{
return this.map.equals(obj);
}
@Override
public int hashCode()
{
return this.map.hashCode();
}
@Override
public String toString()
{
return this.map.toString();
}
public String makeString()
{
return this.map.makeString();
}
public String makeString(String separator)
{
return this.map.makeString(separator);
}
public String makeString(String start, String separator, String end)
{
return this.map.makeString(start, separator, end);
}
public void appendString(Appendable appendable)
{
this.map.appendString(appendable);
}
public void appendString(Appendable appendable, String separator)
{
this.map.appendString(appendable, separator);
}
public void appendString(Appendable appendable, String start, String separator, String end)
{
this.map.appendString(appendable, start, separator, end);
}
public MutableMultimap groupBy(Function super V, ? extends VV> function)
{
return this.map.groupBy(function);
}
public > R groupBy(Function super V, ? extends VV> function, R target)
{
return this.map.groupBy(function, target);
}
public MutableMultimap groupByEach(Function super V, ? extends Iterable> function)
{
return this.map.groupByEach(function);
}
public > R groupByEach(Function super V, ? extends Iterable> function, R target)
{
return this.map.groupByEach(function, target);
}
public MutableMap groupByUniqueKey(Function super V, ? extends V1> function)
{
throw new UnsupportedOperationException(this.getClass().getSimpleName() + ".groupByUniqueKey() not implemented yet");
}
public MutableCollection> zip(Iterable that)
{
return (MutableCollection>) this.map.zip(that);
}
public >> R zip(Iterable that, R target)
{
return this.map.zip(that, target);
}
public MutableLongObjectMap withKeyValue(long key, V value)
{
throw new UnsupportedOperationException("Cannot call withKeyValue() on " + this.getClass().getSimpleName());
}
public MutableLongObjectMap withoutKey(long key)
{
throw new UnsupportedOperationException("Cannot call withoutKey() on " + this.getClass().getSimpleName());
}
public MutableLongObjectMap withoutAllKeys(LongIterable keys)
{
throw new UnsupportedOperationException("Cannot call withoutAllKeys() on " + this.getClass().getSimpleName());
}
public MutableLongObjectMap asUnmodifiable()
{
return this;
}
public MutableLongObjectMap asSynchronized()
{
return new SynchronizedLongObjectMap(this);
}
public ImmutableLongObjectMap toImmutable()
{
return LongObjectMaps.immutable.withAll(this);
}
public void forEach(Procedure super V> procedure)
{
this.map.forEach(procedure);
}
public void forEachWithIndex(ObjectIntProcedure super V> objectIntProcedure)
{
this.map.forEachWithIndex(objectIntProcedure);
}
public void forEachWith(Procedure2 super V, ? super P> procedure, P parameter)
{
this.map.forEachWith(procedure, parameter);
}
public Iterator iterator()
{
return new UnmodifiableIteratorAdapter(this.map.iterator());
}
}