Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.gs.collections.impl.map.immutable.primitive.ImmutableFloatObjectEmptyMap Maven / Gradle / Ivy
Go to download
GS Collections is a collections framework for Java. It has JDK-compatible List, Set and Map
implementations with a rich API and set of utility classes that work with any JDK compatible Collections,
Arrays, Maps or Strings. The iteration protocol was inspired by the Smalltalk collection framework.
/*
* 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.IOException;
import java.io.Serializable;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.NoSuchElementException;
import com.gs.collections.api.FloatIterable;
import com.gs.collections.api.LazyIterable;
import com.gs.collections.api.LazyFloatIterable;
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.impl.bag.sorted.mutable.TreeBag;
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.impl.block.factory.Comparators;
import com.gs.collections.api.block.predicate.Predicate;
import com.gs.collections.api.block.predicate.Predicate2;
import com.gs.collections.api.block.predicate.primitive.FloatObjectPredicate;
import com.gs.collections.api.block.procedure.Procedure;
import com.gs.collections.api.block.procedure.Procedure2;
import com.gs.collections.api.block.procedure.primitive.FloatObjectProcedure;
import com.gs.collections.api.block.procedure.primitive.FloatProcedure;
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.list.MutableList;
import com.gs.collections.api.map.MapIterable;
import com.gs.collections.api.map.MutableMap;
import com.gs.collections.api.map.primitive.ObjectDoubleMap;
import com.gs.collections.api.map.primitive.ObjectLongMap;
import com.gs.collections.api.map.primitive.FloatObjectMap;
import com.gs.collections.api.map.primitive.ImmutableFloatObjectMap;
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.MutableFloatSet;
import com.gs.collections.api.set.sorted.MutableSortedSet;
import com.gs.collections.api.tuple.Pair;
import com.gs.collections.api.tuple.primitive.FloatObjectPair;
import com.gs.collections.impl.factory.Bags;
import com.gs.collections.impl.factory.Lists;
import com.gs.collections.impl.factory.Maps;
import com.gs.collections.impl.factory.Sets;
import com.gs.collections.impl.factory.SortedMaps;
import com.gs.collections.impl.factory.SortedSets;
import com.gs.collections.impl.factory.primitive.BooleanLists;
import com.gs.collections.impl.factory.primitive.ByteLists;
import com.gs.collections.impl.factory.primitive.CharLists;
import com.gs.collections.impl.factory.primitive.DoubleLists;
import com.gs.collections.impl.factory.primitive.FloatLists;
import com.gs.collections.impl.factory.primitive.IntLists;
import com.gs.collections.impl.factory.primitive.LongLists;
import com.gs.collections.impl.factory.primitive.ShortLists;
import com.gs.collections.impl.lazy.LazyIterableAdapter;
import com.gs.collections.impl.map.mutable.UnifiedMap;
import com.gs.collections.impl.list.mutable.FastList;
import com.gs.collections.impl.map.mutable.primitive.FloatObjectHashMap;
import com.gs.collections.impl.map.mutable.primitive.ObjectDoubleHashMap;
import com.gs.collections.impl.map.mutable.primitive.ObjectLongHashMap;
import com.gs.collections.impl.multimap.list.FastListMultimap;
import com.gs.collections.impl.partition.list.PartitionFastList;
import com.gs.collections.impl.set.mutable.primitive.FloatHashSet;
import com.gs.collections.impl.set.mutable.primitive.UnmodifiableFloatSet;
import com.gs.collections.impl.utility.LazyIterate;
import com.gs.collections.impl.utility.primitive.LazyFloatIterate;
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;
/**
* ImmutableFloatObjectEmptyMap is an optimization for {@link ImmutableFloatObjectMap} of size 0.
* This file was automatically generated from template file immutablePrimitiveObjectEmptyMap.stg.
*
* @since 4.0.
*/
final class ImmutableFloatObjectEmptyMap implements ImmutableFloatObjectMap, Serializable
{
static final ImmutableFloatObjectMap> INSTANCE = new ImmutableFloatObjectEmptyMap();
private static final long serialVersionUID = 1L;
private Object readResolve()
{
return INSTANCE;
}
public V get(float key)
{
return null;
}
public V getIfAbsent(float key, Function0 extends V> ifAbsent)
{
return ifAbsent.value();
}
public boolean containsKey(float key)
{
return false;
}
public boolean containsValue(Object value)
{
return false;
}
public ImmutableFloatObjectMap tap(Procedure super V> procedure)
{
return this;
}
public void forEachValue(Procedure super V> procedure)
{
}
public void forEachKey(FloatProcedure procedure)
{
}
public void forEachKeyValue(FloatObjectProcedure super V> procedure)
{
}
public ImmutableFloatObjectMap select(FloatObjectPredicate super V> predicate)
{
return this;
}
public ImmutableFloatObjectMap reject(FloatObjectPredicate super V> predicate)
{
return this;
}
public ImmutableFloatObjectMap toImmutable()
{
return this;
}
public int size()
{
return 0;
}
public boolean isEmpty()
{
return true;
}
public boolean notEmpty()
{
return false;
}
public V getFirst()
{
return null;
}
public V getLast()
{
return null;
}
public boolean contains(Object object)
{
return false;
}
public boolean containsAllIterable(Iterable> source)
{
return !source.iterator().hasNext();
}
public boolean containsAll(Collection> source)
{
return source.isEmpty();
}
public boolean containsAllArguments(Object... elements)
{
return elements.length == 0;
}
public ImmutableCollection select(Predicate super V> predicate)
{
return Lists.immutable.with();
}
public > R select(Predicate super V> predicate, R target)
{
return target;
}
public ImmutableCollection selectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return Lists.immutable.with();
}
public > R selectWith(Predicate2 super V, ? super P> predicate, P parameter, R targetCollection)
{
return targetCollection;
}
public ImmutableCollection reject(Predicate super V> predicate)
{
return Lists.immutable.with();
}
public > R reject(Predicate super V> predicate, R target)
{
return target;
}
public ImmutableCollection rejectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return Lists.immutable.with();
}
public > R rejectWith(Predicate2 super V, ? super P> predicate, P parameter, R targetCollection)
{
return targetCollection;
}
public PartitionIterable partition(Predicate super V> predicate)
{
return new PartitionFastList();
}
public PartitionIterable partitionWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return new PartitionFastList();
}
public RichIterable selectInstancesOf(Class clazz)
{
return Lists.mutable.with();
}
public ImmutableCollection collect(Function super V, ? extends VV> function)
{
return Lists.immutable.with();
}
public ImmutableBooleanCollection collectBoolean(BooleanFunction super V> booleanFunction)
{
return BooleanLists.immutable.with();
}
public R collectBoolean(BooleanFunction super V> booleanFunction, R target)
{
return target;
}
public ImmutableByteCollection collectByte(ByteFunction super V> byteFunction)
{
return ByteLists.immutable.with();
}
public R collectByte(ByteFunction super V> byteFunction, R target)
{
return target;
}
public ImmutableCharCollection collectChar(CharFunction super V> charFunction)
{
return CharLists.immutable.with();
}
public R collectChar(CharFunction super V> charFunction, R target)
{
return target;
}
public ImmutableDoubleCollection collectDouble(DoubleFunction super V> doubleFunction)
{
return DoubleLists.immutable.with();
}
public R collectDouble(DoubleFunction super V> doubleFunction, R target)
{
return target;
}
public ImmutableFloatCollection collectFloat(FloatFunction super V> floatFunction)
{
return FloatLists.immutable.with();
}
public R collectFloat(FloatFunction super V> floatFunction, R target)
{
return target;
}
public ImmutableIntCollection collectInt(IntFunction super V> intFunction)
{
return IntLists.immutable.with();
}
public R collectInt(IntFunction super V> intFunction, R target)
{
return target;
}
public ImmutableLongCollection collectLong(LongFunction super V> longFunction)
{
return LongLists.immutable.with();
}
public R collectLong(LongFunction super V> longFunction, R target)
{
return target;
}
public ImmutableShortCollection collectShort(ShortFunction super V> shortFunction)
{
return ShortLists.immutable.with();
}
public R collectShort(ShortFunction super V> shortFunction, R target)
{
return target;
}
public RichIterable collectIf(Predicate super V> predicate, Function super V, ? extends VV> function)
{
return Lists.mutable.with();
}
public RichIterable flatCollect(Function super V, ? extends Iterable> function)
{
return Lists.mutable.with();
}
public V detect(Predicate super V> predicate)
{
return null;
}
public V detectWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return null;
}
public V detectIfNone(Predicate super V> predicate, Function0 extends V> function)
{
return function.value();
}
public
V detectWithIfNone(Predicate2 super V, ? super P> predicate, P parameter, Function0 extends V> function)
{
return function.value();
}
public int count(Predicate super V> predicate)
{
return 0;
}
public
int countWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return 0;
}
public boolean anySatisfy(Predicate super V> predicate)
{
return false;
}
public
boolean anySatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return false;
}
public boolean allSatisfy(Predicate super V> predicate)
{
return true;
}
public
boolean allSatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return true;
}
public boolean noneSatisfy(Predicate super V> predicate)
{
return true;
}
public
boolean noneSatisfyWith(Predicate2 super V, ? super P> predicate, P parameter)
{
return true;
}
public IV injectInto(IV injectedValue, Function2 super IV, ? super V, ? extends IV> function)
{
return injectedValue;
}
public int injectInto(int injectedValue, IntObjectToIntFunction super V> function)
{
return injectedValue;
}
public long injectInto(long injectedValue, LongObjectToLongFunction super V> function)
{
return injectedValue;
}
public float injectInto(float injectedValue, FloatObjectToFloatFunction super V> function)
{
return injectedValue;
}
public double injectInto(double injectedValue, DoubleObjectToDoubleFunction super V> function)
{
return injectedValue;
}
public MutableList toList()
{
return Lists.mutable.with();
}
public MutableList toSortedList()
{
return Lists.mutable.with();
}
public MutableList toSortedList(Comparator super V> comparator)
{
return Lists.mutable.with();
}
public MutableSet toSet()
{
return Sets.mutable.with();
}
public MutableSortedSet toSortedSet()
{
return SortedSets.mutable.with();
}
public MutableSortedSet toSortedSet(Comparator super V> comparator)
{
return SortedSets.mutable.with();
}
public MutableBag toBag()
{
return Bags.mutable.with();
}
public MutableSortedBag toSortedBag()
{
return TreeBag.newBag();
}
public MutableSortedBag toSortedBag(Comparator super V> comparator)
{
return TreeBag.newBag(comparator);
}
public > MutableSortedBag toSortedBagBy(Function super V, ? extends VV> function)
{
return TreeBag.newBag(Comparators.byFunction(function));
}
public MutableMap toMap(Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return Maps.mutable.with();
}
public MutableSortedMap toSortedMap(Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return SortedMaps.mutable.with();
}
public MutableSortedMap toSortedMap(Comparator super NK> comparator, Function super V, ? extends NK> keyFunction, Function super V, ? extends NV> valueFunction)
{
return SortedMaps.mutable.with();
}
public LazyIterable asLazy()
{
return new LazyIterableAdapter(FastList.newListWith());
}
public Object[] toArray()
{
return new Object[0];
}
public T[] toArray(T[] a)
{
return (T[]) new Object[0];
}
public V min(Comparator super V> comparator)
{
throw new NoSuchElementException();
}
public V max(Comparator super V> comparator)
{
throw new NoSuchElementException();
}
public V min()
{
throw new NoSuchElementException();
}
public V max()
{
throw new NoSuchElementException();
}
public long sumOfInt(IntFunction super V> function)
{
return 0L;
}
public double sumOfFloat(FloatFunction super V> function)
{
return 0.0;
}
public long sumOfLong(LongFunction super V> function)
{
return 0L;
}
public double sumOfDouble(DoubleFunction super V> function)
{
return 0.0;
}
public ObjectLongMap sumByInt(Function groupBy, IntFunction super V> function)
{
return ObjectLongHashMap.newMap();
}
public ObjectDoubleMap sumByFloat(Function groupBy, FloatFunction super V> function)
{
return ObjectDoubleHashMap.newMap();
}
public ObjectLongMap sumByLong(Function groupBy, LongFunction super V> function)
{
return ObjectLongHashMap.newMap();
}
public ObjectDoubleMap sumByDouble(Function groupBy, DoubleFunction super V> function)
{
return ObjectDoubleHashMap.newMap();
}
public MutableFloatSet keySet()
{
return UnmodifiableFloatSet.of(FloatHashSet.newSetWith());
}
public Collection values()
{
return Lists.immutable.of().castToList();
}
public LazyFloatIterable keysView()
{
return LazyFloatIterate.empty();
}
public RichIterable> keyValuesView()
{
return LazyIterate.empty();
}
@Override
public boolean equals(Object obj)
{
if (obj == this)
{
return true;
}
if (!(obj instanceof FloatObjectMap))
{
return false;
}
FloatObjectMap map = (FloatObjectMap) obj;
return map.isEmpty();
}
@Override
public int hashCode()
{
return 0;
}
@Override
public String toString()
{
return "{}";
}
public String makeString()
{
return "";
}
public String makeString(String separator)
{
return "";
}
public String makeString(String start, String separator, String end)
{
return start + end;
}
public void appendString(Appendable appendable)
{
}
public void appendString(Appendable appendable, String separator)
{
}
public void appendString(Appendable appendable, String start, String separator, String end)
{
try
{
appendable.append(start);
appendable.append(end);
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
public Multimap groupBy(Function super V, ? extends VV> function)
{
return FastListMultimap.newMultimap();
}
public > R groupBy(Function super V, ? extends VV> function, R target)
{
return target;
}
public Multimap groupByEach(Function super V, ? extends Iterable> function)
{
return FastListMultimap.newMultimap();
}
public > R groupByEach(Function super V, ? extends Iterable> function, R target)
{
return target;
}
public MapIterable groupByUniqueKey(Function super V, ? extends VV> function)
{
return UnifiedMap.newMap();
}
public > R groupByUniqueKey(Function super V, ? extends VV> function, R target)
{
return target;
}
public RichIterable> zip(Iterable that)
{
return Lists.immutable.of();
}
public >> R zip(Iterable that, R target)
{
return target;
}
public RichIterable> zipWithIndex()
{
return Lists.immutable.of();
}
public >> R zipWithIndex(R target)
{
return target;
}
public RichIterable> chunk(int size)
{
return Lists.immutable.of();
}
public MapIterable aggregateInPlaceBy(Function super V, ? extends K> groupBy, Function0 extends VV> zeroValueFactory, Procedure2 super VV, ? super V> mutatingAggregator)
{
return Maps.immutable.with();
}
public MapIterable aggregateBy(Function super V, ? extends K> groupBy, Function0 extends VV> zeroValueFactory, Function2 super VV, ? super V, ? extends VV> nonMutatingAggregator)
{
return Maps.immutable.with();
}
public > V maxBy(Function super V, ? extends VV> function)
{
throw new NoSuchElementException();
}
public > V minBy(Function super V, ? extends VV> function)
{
throw new NoSuchElementException();
}
public > MutableSortedSet toSortedSetBy(Function super V, ? extends VV> function)
{
return SortedSets.mutable.of();
}
public > MutableList toSortedListBy(Function super V, ? extends VV> function)
{
return Lists.mutable.of();
}
public > R flatCollect(Function super V, ? extends Iterable> function, R target)
{
return target;
}
public > R collectIf(Predicate super V> predicate, Function super V, ? extends VV> function, R target)
{
return target;
}
public ImmutableCollection collectWith(Function2 super V, ? super P, ? extends VV> function, P parameter)
{
return Lists.immutable.with();
}
public > R collectWith(Function2 super V, ? super P, ? extends VV> function, P parameter, R targetCollection)
{
return targetCollection;
}
public > R collect(Function super V, ? extends VV> function, R target)
{
return target;
}
public ImmutableFloatObjectMap newWithKeyValue(float key, V value)
{
FloatObjectHashMap map = new FloatObjectHashMap();
map.put(key, value);
return map.toImmutable();
}
public ImmutableFloatObjectMap newWithoutKey(float key)
{
return this;
}
public ImmutableFloatObjectMap newWithoutAllKeys(FloatIterable keys)
{
return this;
}
public void forEach(Procedure super V> procedure)
{
}
public void each(Procedure super V> procedure)
{
}
public void forEachWithIndex(ObjectIntProcedure super V> objectIntProcedure)
{
}
public void forEachWith(Procedure2 super V, ? super P> procedure, P parameter)
{
}
public Iterator iterator()
{
return new InternalIterator();
}
private class InternalIterator implements Iterator
{
public boolean hasNext()
{
return false;
}
public V next()
{
throw new NoSuchElementException();
}
public void remove()
{
throw new UnsupportedOperationException("Cannot call remove() on " + this.getClass().getSimpleName());
}
}
}