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

org.eclipse.collections.impl.map.immutable.primitive.ImmutableFloatObjectEmptyMap Maven / Gradle / Ivy

Go to download

Builds the commons-text. Requires eclipse-collections-api be built first and be excluded from any other poms requiring it.

There is a newer version: 11.1.0-r13
Show newest version
/*
 * Copyright (c) 2022 Goldman Sachs and others.
 * 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.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.Map;
import java.util.NoSuchElementException;
import java.util.Optional;

import org.eclipse.collections.api.BooleanIterable;
import org.eclipse.collections.api.ByteIterable;
import org.eclipse.collections.api.CharIterable;
import org.eclipse.collections.api.DoubleIterable;
import org.eclipse.collections.api.FloatIterable;
import org.eclipse.collections.api.IntIterable;
import org.eclipse.collections.api.LongIterable;
import org.eclipse.collections.api.ShortIterable;
import org.eclipse.collections.api.LazyFloatIterable;
import org.eclipse.collections.api.LazyIterable;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.bag.ImmutableBag;
import org.eclipse.collections.api.bag.MutableBag;
import org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag;
import org.eclipse.collections.api.bag.primitive.ImmutableByteBag;
import org.eclipse.collections.api.bag.primitive.ImmutableCharBag;
import org.eclipse.collections.api.bag.primitive.ImmutableDoubleBag;
import org.eclipse.collections.api.bag.primitive.ImmutableFloatBag;
import org.eclipse.collections.api.bag.primitive.ImmutableIntBag;
import org.eclipse.collections.api.bag.primitive.ImmutableLongBag;
import org.eclipse.collections.api.bag.primitive.ImmutableShortBag;
import org.eclipse.collections.api.bag.sorted.MutableSortedBag;
import org.eclipse.collections.api.bimap.MutableBiMap;
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.predicate.primitive.FloatObjectPredicate;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.block.procedure.Procedure2;
import org.eclipse.collections.api.block.procedure.primitive.FloatObjectProcedure;
import org.eclipse.collections.api.block.procedure.primitive.FloatProcedure;
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.factory.Lists;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.map.ImmutableMap;
import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.collections.api.map.MutableMapIterable;
import org.eclipse.collections.api.map.primitive.FloatObjectMap;
import org.eclipse.collections.api.map.primitive.ImmutableFloatObjectMap;
import org.eclipse.collections.api.map.primitive.ImmutableObjectFloatMap;
import org.eclipse.collections.api.map.primitive.ImmutableObjectDoubleMap;
import org.eclipse.collections.api.map.primitive.ImmutableObjectLongMap;
import org.eclipse.collections.api.map.sorted.MutableSortedMap;
import org.eclipse.collections.api.multimap.MutableMultimap;
import org.eclipse.collections.api.multimap.bag.ImmutableBagMultimap;
import org.eclipse.collections.api.partition.bag.PartitionImmutableBag;
import org.eclipse.collections.api.set.ImmutableSet;
import org.eclipse.collections.api.set.MutableSet;
import org.eclipse.collections.api.set.primitive.MutableFloatSet;
import org.eclipse.collections.api.set.sorted.MutableSortedSet;
import org.eclipse.collections.api.tuple.Pair;
import org.eclipse.collections.api.tuple.primitive.FloatObjectPair;
import org.eclipse.collections.impl.bag.sorted.mutable.TreeBag;
import org.eclipse.collections.impl.factory.Bags;
import org.eclipse.collections.impl.factory.BiMaps;
import org.eclipse.collections.impl.factory.Maps;
import org.eclipse.collections.impl.factory.Multimaps;
import org.eclipse.collections.impl.factory.Sets;
import org.eclipse.collections.impl.factory.SortedMaps;
import org.eclipse.collections.impl.factory.SortedSets;
import org.eclipse.collections.impl.factory.primitive.BooleanBags;
import org.eclipse.collections.impl.factory.primitive.ByteBags;
import org.eclipse.collections.impl.factory.primitive.CharBags;
import org.eclipse.collections.impl.factory.primitive.DoubleBags;
import org.eclipse.collections.impl.factory.primitive.FloatBags;
import org.eclipse.collections.impl.factory.primitive.IntBags;
import org.eclipse.collections.impl.factory.primitive.LongBags;
import org.eclipse.collections.impl.factory.primitive.ShortBags;
import org.eclipse.collections.impl.factory.primitive.ObjectDoubleMaps;
import org.eclipse.collections.impl.factory.primitive.ObjectLongMaps;
import org.eclipse.collections.impl.factory.primitive.ObjectFloatMaps;
import org.eclipse.collections.impl.lazy.LazyIterableAdapter;
import org.eclipse.collections.impl.map.mutable.primitive.FloatObjectHashMap;
import org.eclipse.collections.impl.partition.bag.PartitionHashBag;
import org.eclipse.collections.impl.set.mutable.primitive.FloatHashSet;
import org.eclipse.collections.impl.set.mutable.primitive.UnmodifiableFloatSet;
import org.eclipse.collections.impl.utility.LazyIterate;
import org.eclipse.collections.impl.utility.primitive.LazyFloatIterate;

/**
 * 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;
    }

    @Override
    public V get(float key)
    {
        return null;
    }

    @Override
    public V getIfAbsent(float key, Function0 ifAbsent)
    {
        return ifAbsent.value();
    }

    @Override
    public boolean containsKey(float key)
    {
        return false;
    }

    @Override
    public boolean containsValue(Object value)
    {
        return false;
    }

    @Override
    public ImmutableFloatObjectMap tap(Procedure procedure)
    {
        return this;
    }

    @Override
    public void forEachValue(Procedure procedure)
    {
    }

    @Override
    public void forEachKey(FloatProcedure procedure)
    {
    }

    @Override
    public void forEachKeyValue(FloatObjectProcedure procedure)
    {
    }

    @Override
    public ImmutableFloatObjectMap select(FloatObjectPredicate predicate)
    {
        return this;
    }

    @Override
    public ImmutableFloatObjectMap reject(FloatObjectPredicate predicate)
    {
        return this;
    }

    @Override
    public ImmutableFloatObjectMap toImmutable()
    {
        return this;
    }

    @Override
    public int size()
    {
        return 0;
    }

    @Override
    public boolean isEmpty()
    {
        return true;
    }

    @Override
    public boolean notEmpty()
    {
        return false;
    }

    @Override
    public V getFirst()
    {
        return null;
    }

    @Override
    public V getLast()
    {
        return null;
    }

    @Override
    public V getOnly()
    {
        throw new IllegalStateException("Size must be 1 but was " + this.size());
    }

    @Override
    public boolean contains(Object object)
    {
        return false;
    }

    @Override
    public boolean containsAllIterable(Iterable source)
    {
        return !source.iterator().hasNext();
    }

    @Override
    public boolean containsAll(Collection source)
    {
        return source.isEmpty();
    }

    @Override
    public boolean containsAllArguments(Object... elements)
    {
        return elements.length == 0;
    }

    @Override
    public ImmutableBag select(Predicate predicate)
    {
        return Bags.immutable.empty();
    }

    @Override
    public 

ImmutableBag selectWith(Predicate2 predicate, P parameter) { return Bags.immutable.empty(); } @Override public ImmutableBag reject(Predicate predicate) { return Bags.immutable.empty(); } @Override public

ImmutableBag rejectWith(Predicate2 predicate, P parameter) { return Bags.immutable.empty(); } @Override public > R select(Predicate predicate, R target) { return target; } @Override public > R selectWith(Predicate2 predicate, P parameter, R target) { return target; } @Override public > R reject(Predicate predicate, R target) { return target; } @Override public > R rejectWith(Predicate2 predicate, P parameter, R target) { return target; } @Override public PartitionImmutableBag partition(Predicate predicate) { return new PartitionHashBag().toImmutable(); } @Override public

PartitionImmutableBag partitionWith(Predicate2 predicate, P parameter) { return new PartitionHashBag().toImmutable(); } @Override public ImmutableBag selectInstancesOf(Class clazz) { return Bags.immutable.empty(); } @Override public ImmutableBag collect(Function function) { return Bags.immutable.empty(); } @Override public ImmutableBag collectWith(Function2 function, P parameter) { return Bags.immutable.empty(); } @Override public ImmutableBag collectIf(Predicate predicate, Function function) { return Bags.immutable.empty(); } @Override public ImmutableBooleanBag collectBoolean(BooleanFunction booleanFunction) { return BooleanBags.immutable.empty(); } @Override public R collectBoolean(BooleanFunction booleanFunction, R target) { return target; } @Override public ImmutableByteBag collectByte(ByteFunction byteFunction) { return ByteBags.immutable.empty(); } @Override public R collectByte(ByteFunction byteFunction, R target) { return target; } @Override public ImmutableCharBag collectChar(CharFunction charFunction) { return CharBags.immutable.empty(); } @Override public R collectChar(CharFunction charFunction, R target) { return target; } @Override public ImmutableDoubleBag collectDouble(DoubleFunction doubleFunction) { return DoubleBags.immutable.empty(); } @Override public R collectDouble(DoubleFunction doubleFunction, R target) { return target; } @Override public ImmutableFloatBag collectFloat(FloatFunction floatFunction) { return FloatBags.immutable.empty(); } @Override public R collectFloat(FloatFunction floatFunction, R target) { return target; } @Override public ImmutableIntBag collectInt(IntFunction intFunction) { return IntBags.immutable.empty(); } @Override public R collectInt(IntFunction intFunction, R target) { return target; } @Override public ImmutableLongBag collectLong(LongFunction longFunction) { return LongBags.immutable.empty(); } @Override public R collectLong(LongFunction longFunction, R target) { return target; } @Override public ImmutableShortBag collectShort(ShortFunction shortFunction) { return ShortBags.immutable.empty(); } @Override public R collectShort(ShortFunction shortFunction, R target) { return target; } @Override public ImmutableBag flatCollect(Function> function) { return Bags.immutable.empty(); } @Override public R flatCollectByte( Function function, R target) { return target; } @Override public R flatCollectChar( Function function, R target) { return target; } @Override public R flatCollectInt( Function function, R target) { return target; } @Override public R flatCollectShort( Function function, R target) { return target; } @Override public R flatCollectDouble( Function function, R target) { return target; } @Override public R flatCollectFloat( Function function, R target) { return target; } @Override public R flatCollectLong( Function function, R target) { return target; } @Override public R flatCollectBoolean( Function function, R target) { return target; } @Override public V detect(Predicate predicate) { return null; } @Override public

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

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

V detectWithIfNone(Predicate2 predicate, P parameter, Function0 function) { return function.value(); } @Override public int count(Predicate predicate) { return 0; } @Override public

int countWith(Predicate2 predicate, P parameter) { return 0; } @Override public boolean anySatisfy(Predicate predicate) { return false; } @Override public

boolean anySatisfyWith(Predicate2 predicate, P parameter) { return false; } @Override public boolean allSatisfy(Predicate predicate) { return true; } @Override public

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

boolean noneSatisfyWith(Predicate2 predicate, P parameter) { return true; } @Override public IV injectInto(IV injectedValue, Function2 function) { return injectedValue; } @Override public int injectInto(int injectedValue, IntObjectToIntFunction function) { return injectedValue; } @Override public long injectInto(long injectedValue, LongObjectToLongFunction function) { return injectedValue; } @Override public float injectInto(float injectedValue, FloatObjectToFloatFunction function) { return injectedValue; } @Override public double injectInto(double injectedValue, DoubleObjectToDoubleFunction function) { return injectedValue; } @Override public > R into(R target) { return target; } @Override public MutableList toList() { return Lists.mutable.with(); } @Override public MutableList toSortedList() { return Lists.mutable.with(); } @Override public MutableList toSortedList(Comparator comparator) { return Lists.mutable.with(); } @Override public MutableSet toSet() { return Sets.mutable.with(); } @Override public MutableSortedSet toSortedSet() { return SortedSets.mutable.with(); } @Override public MutableSortedSet toSortedSet(Comparator comparator) { return SortedSets.mutable.with(); } @Override public MutableBag toBag() { return Bags.mutable.with(); } @Override public MutableSortedBag toSortedBag() { return TreeBag.newBag(); } @Override public MutableSortedBag toSortedBag(Comparator comparator) { return TreeBag.newBag(comparator); } @Override public MutableMap toMap(Function keyFunction, Function valueFunction) { return Maps.mutable.with(); } @Override public > R toMap(Function keyFunction, Function valueFunction, R target) { return target; } @Override public MutableSortedMap toSortedMap(Function keyFunction, Function valueFunction) { return SortedMaps.mutable.with(); } @Override public MutableSortedMap toSortedMap(Comparator comparator, Function keyFunction, Function valueFunction) { return SortedMaps.mutable.with(); } @Override public , NK, NV> MutableSortedMap toSortedMapBy(Function sortBy, Function keyFunction, Function valueFunction) { return SortedMaps.mutable.with(); } @Override public MutableBiMap toBiMap(Function keyFunction, Function valueFunction) { return BiMaps.mutable.empty(); } @Override public LazyIterable asLazy() { return new LazyIterableAdapter<>(Lists.immutable.empty()); } @Override public Object[] toArray() { return new Object[0]; } @Override public T[] toArray(T[] a) { return (T[]) new Object[0]; } @Override public V min(Comparator comparator) { throw new NoSuchElementException(); } @Override public V max(Comparator comparator) { throw new NoSuchElementException(); } @Override public V min() { throw new NoSuchElementException(); } @Override public V max() { throw new NoSuchElementException(); } @Override public long sumOfInt(IntFunction function) { return 0L; } @Override public double sumOfFloat(FloatFunction function) { return 0.0; } @Override public long sumOfLong(LongFunction function) { return 0L; } @Override public double sumOfDouble(DoubleFunction function) { return 0.0; } @Override public ImmutableObjectLongMap sumByInt(Function groupBy, IntFunction function) { return ObjectLongMaps.immutable.empty(); } @Override public ImmutableObjectDoubleMap sumByFloat(Function groupBy, FloatFunction function) { return ObjectDoubleMaps.immutable.empty(); } @Override public ImmutableObjectLongMap sumByLong(Function groupBy, LongFunction function) { return ObjectLongMaps.immutable.empty(); } @Override public ImmutableObjectDoubleMap sumByDouble(Function groupBy, DoubleFunction function) { return ObjectDoubleMaps.immutable.empty(); } @Override public MutableFloatSet keySet() { return UnmodifiableFloatSet.of(FloatHashSet.newSetWith()); } @Override public Collection values() { return Lists.immutable.of().castToList(); } @Override public LazyFloatIterable keysView() { return LazyFloatIterate.empty(); } @Override public RichIterable> keyValuesView() { return LazyIterate.empty(); } @Override public ImmutableObjectFloatMap flipUniqueValues() { return ObjectFloatMaps.immutable.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 "{}"; } @Override public String makeString() { return ""; } @Override public String makeString(String separator) { return ""; } @Override public String makeString(String start, String separator, String end) { return start + end; } @Override public void appendString(Appendable appendable) { } @Override public void appendString(Appendable appendable, String separator) { } @Override 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); } } @Override public ImmutableBagMultimap groupBy(Function function) { return Multimaps.immutable.bag.empty(); } @Override public > R groupBy(Function function, R target) { return target; } @Override public ImmutableBagMultimap groupByEach(Function> function) { return Multimaps.immutable.bag.empty(); } @Override public > R groupByEach(Function> function, R target) { return target; } @Override public ImmutableMap groupByUniqueKey(Function function) { return Maps.immutable.empty(); } @Override public > R groupByUniqueKey(Function function, R target) { return target; } @Override public ImmutableBag> zip(Iterable that) { return Bags.immutable.empty(); } @Override public >> R zip(Iterable that, R target) { return target; } @Override public ImmutableSet> zipWithIndex() { return Sets.immutable.empty(); } @Override public >> R zipWithIndex(R target) { return target; } @Override public RichIterable> chunk(int size) { return Lists.immutable.of(); } @Override public > V maxBy(Function function) { throw new NoSuchElementException(); } @Override public > V minBy(Function function) { throw new NoSuchElementException(); } @Override public > MutableSortedSet toSortedSetBy(Function function) { return SortedSets.mutable.of(); } @Override public > MutableList toSortedListBy(Function function) { return Lists.mutable.of(); } @Override public > R flatCollect(Function> function, R target) { return target; } @Override public > R collectIf(Predicate predicate, Function function, R target) { return target; } @Override public > R collectWith(Function2 function, P parameter, R targetCollection) { return targetCollection; } @Override public > R collect(Function function, R target) { return target; } @Override public ImmutableFloatObjectMap newWithKeyValue(float key, V value) { FloatObjectHashMap map = new FloatObjectHashMap<>(); map.put(key, value); return map.toImmutable(); } @Override public ImmutableFloatObjectMap newWithoutKey(float key) { return this; } @Override public ImmutableFloatObjectMap newWithoutAllKeys(FloatIterable keys) { return this; } @Override public void forEach(Procedure procedure) { } @Override public void each(Procedure procedure) { } @Override public void forEachWithIndex(ObjectIntProcedure objectIntProcedure) { } @Override public

void forEachWith(Procedure2 procedure, P parameter) { } @Override public Iterator iterator() { return new InternalIterator(); } private class InternalIterator implements Iterator { @Override public boolean hasNext() { return false; } @Override public V next() { throw new NoSuchElementException(); } @Override public void remove() { throw new UnsupportedOperationException("Cannot call remove() on " + this.getClass().getSimpleName()); } } }