package org.eclipse.collections.impl.list.mutable.primitive;
import java.util.Collection;
import org.eclipse.collections.api.FloatIterable;
import org.eclipse.collections.api.LazyFloatIterable;
import org.eclipse.collections.api.block.function.primitive.FloatIntToObjectFunction;
import org.eclipse.collections.api.block.function.primitive.FloatToObjectFunction;
import org.eclipse.collections.api.block.function.primitive.ObjectFloatIntToObjectFunction;
import org.eclipse.collections.api.block.predicate.primitive.FloatPredicate;
import org.eclipse.collections.api.block.procedure.primitive.FloatIntProcedure;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.tuple.primitive.FloatFloatPair;
import org.eclipse.collections.api.tuple.primitive.FloatObjectPair;
import org.eclipse.collections.api.list.primitive.FloatList;
import org.eclipse.collections.api.list.primitive.ImmutableFloatList;
import org.eclipse.collections.api.list.primitive.MutableFloatList;
import org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableFloatCollection;
import org.eclipse.collections.impl.factory.primitive.FloatLists;
import org.eclipse.collections.impl.lazy.primitive.ReverseFloatIterable;
public class UnmodifiableFloatList
extends AbstractUnmodifiableFloatCollection
implements MutableFloatList
{
private static final long serialVersionUID = 1L;
public UnmodifiableFloatList(MutableFloatList list)
{
super(list);
}
private MutableFloatList getMutableFloatList()
{
return (MutableFloatList) this.getFloatCollection();
}
@Override
public float get(int index)
{
return this.getMutableFloatList().get(index);
}
@Override
public float getFirst()
{
return this.getMutableFloatList().getFirst();
}
@Override
public float getLast()
{
return this.getMutableFloatList().getLast();
}
@Override
public int indexOf(float value)
{
return this.getMutableFloatList().indexOf(value);
}
@Override
public int lastIndexOf(float value)
{
return this.getMutableFloatList().lastIndexOf(value);
}
@Override
public void addAtIndex(int index, float element)
{
throw new UnsupportedOperationException("Cannot call addAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public boolean addAllAtIndex(int index, float... source)
{
throw new UnsupportedOperationException("Cannot call addAllAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public boolean addAllAtIndex(int index, FloatIterable source)
{
throw new UnsupportedOperationException("Cannot call addAllAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public float removeAtIndex(int index)
{
throw new UnsupportedOperationException("Cannot call removeAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public float set(int index, float element)
{
throw new UnsupportedOperationException("Cannot call set() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableFloatList with(float element)
{
throw new UnsupportedOperationException("Cannot call with() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableFloatList without(float element)
{
throw new UnsupportedOperationException("Cannot call without() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableFloatList withAll(FloatIterable elements)
{
throw new UnsupportedOperationException("Cannot call withAll() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableFloatList withoutAll(FloatIterable elements)
{
throw new UnsupportedOperationException("Cannot call withoutAll() on " + this.getClass().getSimpleName());
}
@Override
public MutableFloatList select(FloatPredicate predicate)
{
return this.getMutableFloatList().select(predicate);
}
@Override
public MutableFloatList reject(FloatPredicate predicate)
{
return this.getMutableFloatList().reject(predicate);
}
@Override
public <V> MutableList<V> collect(FloatToObjectFunction<? extends V> function)
{
return this.getMutableFloatList().collect(function);
}
@Override
public MutableFloatList sortThis()
{
throw new UnsupportedOperationException("Cannot call sortThis() on " + this.getClass().getSimpleName());
}
@Override
public MutableFloatList shuffleThis()
{
throw new UnsupportedOperationException("Cannot call shuffleThis() on " + this.getClass().getSimpleName());
}
@Override
public int binarySearch(float value)
{
return this.getMutableFloatList().binarySearch(value);
}
@Override
public double dotProduct(FloatList list)
{
return this.getMutableFloatList().dotProduct(list);
}
@Override
public boolean equals(Object otherList)
{
return this.getMutableFloatList().equals(otherList);
}
@Override
public int hashCode()
{
return this.getMutableFloatList().hashCode();
}
@Override
public MutableFloatList asUnmodifiable()
{
return this;
}
@Override
public MutableFloatList asSynchronized()
{
return new SynchronizedFloatList(this);
}
@Override
public ImmutableFloatList toImmutable()
{
int size = this.size();
if (size == 0)
{
return FloatLists.immutable.with();
}
if (size == 1)
{
return FloatLists.immutable.with(this.getFirst());
}
return FloatLists.immutable.with(this.toArray());
}
public MutableFloatList newEmpty()
{
return this.getMutableFloatList().newEmpty();
}
@Override
public MutableFloatList reverseThis()
{
throw new UnsupportedOperationException("Cannot call reverseThis() on " + this.getClass().getSimpleName());
}
@Override
public MutableFloatList toReversed()
{
return this.getMutableFloatList().toReversed();
}
@Override
public void forEachWithIndex(FloatIntProcedure procedure)
{
this.getMutableFloatList().forEachWithIndex(procedure);
}
@Override
public LazyFloatIterable asReversed()
{
return ReverseFloatIterable.adapt(this);
}
@Override
public <T> T injectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T, ? extends T> function)
{
return this.getMutableFloatList().injectIntoWithIndex(injectedValue, function);
}
@Override
public MutableFloatList distinct()
{
return this.getMutableFloatList().distinct();
}
@Override
public MutableFloatList subList(int fromIndex, int toIndex)
{
throw new UnsupportedOperationException("subList not yet implemented!");
}
public MutableList<FloatFloatPair> zipFloat(FloatIterable iterable)
{
return this.getMutableFloatList().zipFloat(iterable);
}
public <T> MutableList<FloatObjectPair<T>> zip(Iterable<T> iterable)
{
return this.getMutableFloatList().zip(iterable);
}
@Override
public <V> MutableList<V> collectWithIndex(FloatIntToObjectFunction<? extends V> function)
{
return this.getMutableFloatList().collectWithIndex(function);
}
public <V, R extends Collection<V>> R collectWithIndex(FloatIntToObjectFunction<? extends V> function, R target)
{
return this.getMutableFloatList().collectWithIndex(function, target);
}
}