package org.eclipse.collections.impl.list.mutable.primitive;
import java.util.Collection;
import org.eclipse.collections.api.ShortIterable;
import org.eclipse.collections.api.LazyShortIterable;
import org.eclipse.collections.api.block.function.primitive.ShortIntToObjectFunction;
import org.eclipse.collections.api.block.function.primitive.ShortToObjectFunction;
import org.eclipse.collections.api.block.function.primitive.ObjectShortIntToObjectFunction;
import org.eclipse.collections.api.block.predicate.primitive.ShortPredicate;
import org.eclipse.collections.api.block.procedure.primitive.ShortIntProcedure;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.tuple.primitive.ShortShortPair;
import org.eclipse.collections.api.tuple.primitive.ShortObjectPair;
import org.eclipse.collections.api.list.primitive.ShortList;
import org.eclipse.collections.api.list.primitive.ImmutableShortList;
import org.eclipse.collections.api.list.primitive.MutableShortList;
import org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableShortCollection;
import org.eclipse.collections.impl.factory.primitive.ShortLists;
import org.eclipse.collections.impl.lazy.primitive.ReverseShortIterable;
public class UnmodifiableShortList
extends AbstractUnmodifiableShortCollection
implements MutableShortList
{
private static final long serialVersionUID = 1L;
public UnmodifiableShortList(MutableShortList list)
{
super(list);
}
private MutableShortList getMutableShortList()
{
return (MutableShortList) this.getShortCollection();
}
@Override
public short get(int index)
{
return this.getMutableShortList().get(index);
}
@Override
public short getFirst()
{
return this.getMutableShortList().getFirst();
}
@Override
public short getLast()
{
return this.getMutableShortList().getLast();
}
@Override
public int indexOf(short value)
{
return this.getMutableShortList().indexOf(value);
}
@Override
public int lastIndexOf(short value)
{
return this.getMutableShortList().lastIndexOf(value);
}
@Override
public void addAtIndex(int index, short element)
{
throw new UnsupportedOperationException("Cannot call addAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public boolean addAllAtIndex(int index, short... source)
{
throw new UnsupportedOperationException("Cannot call addAllAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public boolean addAllAtIndex(int index, ShortIterable source)
{
throw new UnsupportedOperationException("Cannot call addAllAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public short removeAtIndex(int index)
{
throw new UnsupportedOperationException("Cannot call removeAtIndex() on " + this.getClass().getSimpleName());
}
@Override
public short set(int index, short element)
{
throw new UnsupportedOperationException("Cannot call set() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableShortList with(short element)
{
throw new UnsupportedOperationException("Cannot call with() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableShortList without(short element)
{
throw new UnsupportedOperationException("Cannot call without() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableShortList withAll(ShortIterable elements)
{
throw new UnsupportedOperationException("Cannot call withAll() on " + this.getClass().getSimpleName());
}
@Override
public UnmodifiableShortList withoutAll(ShortIterable elements)
{
throw new UnsupportedOperationException("Cannot call withoutAll() on " + this.getClass().getSimpleName());
}
@Override
public MutableShortList select(ShortPredicate predicate)
{
return this.getMutableShortList().select(predicate);
}
@Override
public MutableShortList reject(ShortPredicate predicate)
{
return this.getMutableShortList().reject(predicate);
}
@Override
public <V> MutableList<V> collect(ShortToObjectFunction<? extends V> function)
{
return this.getMutableShortList().collect(function);
}
@Override
public MutableShortList sortThis()
{
throw new UnsupportedOperationException("Cannot call sortThis() on " + this.getClass().getSimpleName());
}
@Override
public int binarySearch(short value)
{
return this.getMutableShortList().binarySearch(value);
}
@Override
public long dotProduct(ShortList list)
{
return this.getMutableShortList().dotProduct(list);
}
@Override
public boolean equals(Object otherList)
{
return this.getMutableShortList().equals(otherList);
}
@Override
public int hashCode()
{
return this.getMutableShortList().hashCode();
}
@Override
public MutableShortList asUnmodifiable()
{
return this;
}
@Override
public MutableShortList asSynchronized()
{
return new SynchronizedShortList(this);
}
@Override
public ImmutableShortList toImmutable()
{
int size = this.size();
if (size == 0)
{
return ShortLists.immutable.with();
}
if (size == 1)
{
return ShortLists.immutable.with(this.getFirst());
}
return ShortLists.immutable.with(this.toArray());
}
public MutableShortList newEmpty()
{
return this.getMutableShortList().newEmpty();
}
@Override
public MutableShortList reverseThis()
{
throw new UnsupportedOperationException("Cannot call reverseThis() on " + this.getClass().getSimpleName());
}
@Override
public MutableShortList toReversed()
{
return this.getMutableShortList().toReversed();
}
@Override
public void forEachWithIndex(ShortIntProcedure procedure)
{
this.getMutableShortList().forEachWithIndex(procedure);
}
@Override
public LazyShortIterable asReversed()
{
return ReverseShortIterable.adapt(this);
}
@Override
public <T> T injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T, ? extends T> function)
{
return this.getMutableShortList().injectIntoWithIndex(injectedValue, function);
}
@Override
public MutableShortList distinct()
{
return this.getMutableShortList().distinct();
}
@Override
public MutableShortList subList(int fromIndex, int toIndex)
{
throw new UnsupportedOperationException("subList not yet implemented!");
}
public MutableList<ShortShortPair> zipShort(ShortIterable iterable)
{
return this.getMutableShortList().zipShort(iterable);
}
public <T> MutableList<ShortObjectPair<T>> zip(Iterable<T> iterable)
{
return this.getMutableShortList().zip(iterable);
}
@Override
public <V> MutableList<V> collectWithIndex(ShortIntToObjectFunction<? extends V> function)
{
return this.getMutableShortList().collectWithIndex(function);
}
public <V, R extends Collection<V>> R collectWithIndex(ShortIntToObjectFunction<? extends V> function, R target)
{
return this.getMutableShortList().collectWithIndex(function, target);
}
}