package org.eclipse.collections.api.list;
import java.util.List;
import org.eclipse.collections.api.block.HashingStrategy;
import org.eclipse.collections.api.block.function.Function;
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.FloatFunction;
import org.eclipse.collections.api.block.function.primitive.IntFunction;
import org.eclipse.collections.api.block.function.primitive.LongFunction;
import org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction;
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.ObjectIntPredicate;
import org.eclipse.collections.api.block.procedure.Procedure;
import org.eclipse.collections.api.collection.ImmutableCollection;
import org.eclipse.collections.api.list.primitive.ImmutableBooleanList;
import org.eclipse.collections.api.list.primitive.ImmutableByteList;
import org.eclipse.collections.api.list.primitive.ImmutableCharList;
import org.eclipse.collections.api.list.primitive.ImmutableDoubleList;
import org.eclipse.collections.api.list.primitive.ImmutableFloatList;
import org.eclipse.collections.api.list.primitive.ImmutableIntList;
import org.eclipse.collections.api.list.primitive.ImmutableLongList;
import org.eclipse.collections.api.list.primitive.ImmutableShortList;
import org.eclipse.collections.api.multimap.list.ImmutableListMultimap;
import org.eclipse.collections.api.partition.list.PartitionImmutableList;
import org.eclipse.collections.api.tuple.Pair;
public interface ImmutableList<T>
extends ImmutableCollection<T>, ListIterable<T>
{
@Override
ImmutableList<T> newWith(T element);
@Override
ImmutableList<T> newWithout(T element);
@Override
ImmutableList<T> newWithAll(Iterable<? extends T> elements);
@Override
ImmutableList<T> newWithoutAll(Iterable<? extends T> elements);
@Override
ImmutableList<T> tap(Procedure<? super T> procedure);
@Override
ImmutableList<T> select(Predicate<? super T> predicate);
@Override
<P> ImmutableList<T> selectWith(Predicate2<? super T, ? super P> predicate, P parameter);
@Override
ImmutableList<T> reject(Predicate<? super T> predicate);
@Override
<P> ImmutableList<T> rejectWith(Predicate2<? super T, ? super P> predicate, P parameter);
@Override
PartitionImmutableList<T> partition(Predicate<? super T> predicate);
@Override
<P> PartitionImmutableList<T> partitionWith(Predicate2<? super T, ? super P> predicate, P parameter);
@Override
<S> ImmutableList<S> selectInstancesOf(Class<S> clazz);
@Override
<V> ImmutableList<V> collect(Function<? super T, ? extends V> function);
@Override
default <V> ImmutableList<V> collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function)
{
int[] index = {0};
return this.collect(each -> function.valueOf(each, index[0]++));
}
default ImmutableList<T> selectWithIndex(ObjectIntPredicate<? super T> predicate)
{
int[] index = {0};
return this.select(each -> predicate.accept(each, index[0]++));
}
default ImmutableList<T> rejectWithIndex(ObjectIntPredicate<? super T> predicate)
{
int[] index = {0};
return this.reject(each -> predicate.accept(each, index[0]++));
}
@Override
ImmutableBooleanList collectBoolean(BooleanFunction<? super T> booleanFunction);
@Override
ImmutableByteList collectByte(ByteFunction<? super T> byteFunction);
@Override
ImmutableCharList collectChar(CharFunction<? super T> charFunction);
@Override
ImmutableDoubleList collectDouble(DoubleFunction<? super T> doubleFunction);
@Override
ImmutableFloatList collectFloat(FloatFunction<? super T> floatFunction);
@Override
ImmutableIntList collectInt(IntFunction<? super T> intFunction);
@Override
ImmutableLongList collectLong(LongFunction<? super T> longFunction);
@Override
ImmutableShortList collectShort(ShortFunction<? super T> shortFunction);
@Override
<P, V> ImmutableList<V> collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter);
@Override
<V> ImmutableList<V> collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function);
@Override
<V> ImmutableList<V> flatCollect(Function<? super T, ? extends Iterable<V>> function);
@Override
default <P, V> ImmutableList<V> flatCollectWith(Function2<? super T, ? super P, ? extends Iterable<V>> function, P parameter)
{
return this.flatCollect(each -> function.apply(each, parameter));
}
@Override
<V> ImmutableListMultimap<V, T> groupBy(Function<? super T, ? extends V> function);
@Override
<V> ImmutableListMultimap<V, T> groupByEach(Function<? super T, ? extends Iterable<V>> function);
@Override
ImmutableList<T> distinct();
@Override
ImmutableList<T> distinct(HashingStrategy<? super T> hashingStrategy);
@Override
<V> ImmutableList<T> distinctBy(Function<? super T, ? extends V> function);
@Override
<S> ImmutableList<Pair<T, S>> zip(Iterable<S> that);
@Override
ImmutableList<Pair<T, Integer>> zipWithIndex();
@Override
ImmutableList<T> take(int count);
@Override
ImmutableList<T> takeWhile(Predicate<? super T> predicate);
@Override
ImmutableList<T> drop(int count);
@Override
ImmutableList<T> dropWhile(Predicate<? super T> predicate);
@Override
PartitionImmutableList<T> partitionWhile(Predicate<? super T> predicate);
List<T> castToList();
@Override
ImmutableList<T> subList(int fromIndex, int toIndex);
@Override
ImmutableList<T> toReversed();
@Override
default ImmutableList<T> toImmutableList()
{
return this;
}
}