Top Description Inners Constructors Methods
org.eclipse.collections.impl.list.mutable

public Class UnmodifiableMutableList<T>

extends AbstractUnmodifiableMutableCollection<T>
implements MutableList<T>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.list.ListIterable, org.eclipse.collections.api.ordered.ReversibleIterable, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, java.lang.Cloneable, java.util.List, java.util.SequencedCollection, java.util.Collection, org.eclipse.collections.api.collection.MutableCollection
Known Direct Subclasses
org.eclipse.collections.impl.list.mutable.UnmodifiableMutableList.RandomAccessUnmodifiableMutableList
Imports
java.io.Serializable, java.util.Collection, .Comparator, .List, .ListIterator, .Random, .RandomAccess, java.util.concurrent.ExecutorService, java.util.function.UnaryOperator, org.eclipse.collections.api.LazyIterable, org.eclipse.collections.api.block.HashingStrategy, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.list.ImmutableList, .MutableList, .ParallelListIterable, org.eclipse.collections.api.list.primitive.MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.multimap.list.MutableListMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.list.PartitionMutableList, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection, .UnmodifiableCollectionSerializationProxy, org.eclipse.collections.impl.lazy.ReverseIterable

An unmodifiable view of a list.
See Also
MutableList#asUnmodifiable()

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
pack-priv
UnmodifiableMutableList(MutableList<? extends T> mutableList)

Method Summary

Modifier and TypeMethod and Description
public void
add(int index, T element)

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).

public boolean
addAll(int index, Collection<? extends T> collection)

Implements java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

public ParallelListIterable<T>
asParallel(ExecutorService executorService, int batchSize)

Implements org.eclipse.collections.api.list.ListIterable.asParallel.

Returns a parallel iterable of this ListIterable.

public LazyIterable<T>
asReversed()

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.asReversed.

Returns a reversed view of this ReversibleIterable.

public MutableList<T>
public MutableList<T>
public UnmodifiableMutableList<T>
clone()

Overrides java.lang.Object.clone.

Implements org.eclipse.collections.api.list.MutableList.clone.

Creates and returns a copy of this object.

public <V> MutableList<V>
collect(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collect.

Overrides default org.eclipse.collections.api.list.MutableList.collect.

Implements org.eclipse.collections.api.collection.MutableCollection.collect.

Returns a new MutableCollection with the results of applying the specified function to each element of the source collection.

public MutableBooleanList
collectBoolean(BooleanFunction<? super T> booleanFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectBoolean.

Overrides default org.eclipse.collections.api.list.MutableList.collectBoolean, org.eclipse.collections.api.collection.MutableCollection.collectBoolean.

Returns a new primitive boolean iterable with the results of applying the specified function on each element of the source collection.

public MutableByteList
collectByte(ByteFunction<? super T> byteFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectByte.

Overrides default org.eclipse.collections.api.list.MutableList.collectByte, org.eclipse.collections.api.collection.MutableCollection.collectByte.

Returns a new primitive byte iterable with the results of applying the specified function on each element of the source collection.

public MutableCharList
collectChar(CharFunction<? super T> charFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectChar.

Overrides default org.eclipse.collections.api.list.MutableList.collectChar, org.eclipse.collections.api.collection.MutableCollection.collectChar.

Returns a new primitive char iterable with the results of applying the specified function on each element of the source collection.

public MutableDoubleList
collectDouble(DoubleFunction<? super T> doubleFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectDouble.

Overrides default org.eclipse.collections.api.list.MutableList.collectDouble, org.eclipse.collections.api.collection.MutableCollection.collectDouble.

Returns a new primitive double iterable with the results of applying the specified function on each element of the source collection.

public MutableFloatList
collectFloat(FloatFunction<? super T> floatFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectFloat.

Overrides default org.eclipse.collections.api.list.MutableList.collectFloat, org.eclipse.collections.api.collection.MutableCollection.collectFloat.

Returns a new primitive float iterable with the results of applying the specified function on each element of the source collection.

public <V> MutableList<V>
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectIf.

Overrides default org.eclipse.collections.api.list.MutableList.collectIf.

Implements org.eclipse.collections.api.collection.MutableCollection.collectIf.

Returns a new MutableCollection with the results of applying the specified function to each element of the source collection, but only for elements that evaluate to true for the specified predicate.

public MutableIntList
collectInt(IntFunction<? super T> intFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectInt.

Overrides default org.eclipse.collections.api.list.MutableList.collectInt, org.eclipse.collections.api.collection.MutableCollection.collectInt.

Returns a new primitive int iterable with the results of applying the specified function on each element of the source collection.

public MutableLongList
collectLong(LongFunction<? super T> longFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectLong.

Overrides default org.eclipse.collections.api.list.MutableList.collectLong, org.eclipse.collections.api.collection.MutableCollection.collectLong.

Returns a new primitive long iterable with the results of applying the specified function on each element of the source collection.

public MutableShortList
collectShort(ShortFunction<? super T> shortFunction)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectShort.

Overrides default org.eclipse.collections.api.list.MutableList.collectShort, org.eclipse.collections.api.collection.MutableCollection.collectShort.

Returns a new primitive short iterable with the results of applying the specified function on each element of the source collection.

public <P, A> MutableList<A>
collectWith(Function2<? super T, ? super P, ? extends A> function, P parameter)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.collectWith.

Overrides default org.eclipse.collections.api.list.MutableList.collectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

public <S> boolean
corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.corresponds.

Returns true if both OrderedIterables have the same length and predicate returns true for all corresponding elements e1 of this OrderedIterable and e2 of other.

public int
detectIndex(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.detectIndex.

Returns the index of the first element of the OrderedIterable for which the predicate evaluates to true.

public int
detectLastIndex(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.ordered.ReversibleIterable.detectLastIndex.

Returns the index of the last element of the ReversibleIterable for which the predicate evaluates to true.

public MutableList<T>
distinct()

Implements org.eclipse.collections.api.list.MutableList.distinct.

Returns a new ListIterable containing the distinct elements in this list.

public MutableList<T>
distinct(HashingStrategy<? super T> hashingStrategy)

Implements org.eclipse.collections.api.list.MutableList.distinct.

Returns a new ListIterable containing the distinct elements in this list.

public <V> MutableList<T>
distinctBy(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.list.MutableList.distinctBy.

Returns a new ListIterable containing the distinct elements in this list.

public MutableList<T>
drop(int count)

Implements org.eclipse.collections.api.list.MutableList.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public MutableList<T>
dropWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.MutableList.dropWhile.

Returns the final elements that do not satisfy the Predicate.

public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Implements java.util.Collection.equals, java.util.List.equals, org.eclipse.collections.api.list.ListIterable.equals.

Compares the specified object with this list for equality.

public <V> MutableList<V>
public void
forEach(int fromIndex, int toIndex, Procedure<? super T> procedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEach.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public void
forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public T
get(int index)

Implements java.util.List.get, org.eclipse.collections.api.list.ListIterable.get.

Returns the element at the specified position in this list.

private MutableList<T>
public <V> MutableListMultimap<V, T>
groupBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.groupBy.

Implements org.eclipse.collections.api.list.MutableList.groupBy, org.eclipse.collections.api.collection.MutableCollection.groupBy.

For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable.

public <V> MutableListMultimap<V, T>
public int
public int
indexOf(Object o)

Overrides default org.eclipse.collections.api.list.MutableList.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

public int
lastIndexOf(Object o)

Implements java.util.List.lastIndexOf, org.eclipse.collections.api.list.ListIterable.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

public ListIterator<T>
listIterator()

Implements java.util.List.listIterator, org.eclipse.collections.api.list.ListIterable.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).

public ListIterator<T>
listIterator(int index)

Implements java.util.List.listIterator, org.eclipse.collections.api.list.ListIterable.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.

public MutableList<T>
public static <E, L extends List<E>> UnmodifiableMutableList<E>
of(L list)

Hides java.util.List.of.

This method will take a MutableList and wrap it directly in a UnmodifiableMutableList.

public PartitionMutableList<T>
public PartitionMutableList<T>
partitionWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.MutableList.partitionWhile.

Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements.

public <P> PartitionMutableList<T>
public MutableList<T>
reject(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.reject.

Overrides default org.eclipse.collections.api.list.MutableList.reject.

Implements org.eclipse.collections.api.collection.MutableCollection.reject.

Returns a MutableCollection with all elements that evaluate to false for the specified predicate.

public <P> MutableList<T>
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.rejectWith.

Overrides default org.eclipse.collections.api.list.MutableList.rejectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.rejectWith.

Returns a MutableCollection with all elements that evaluate to false for the specified predicate2 and parameter.

public T
remove(int index)

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).

public void
replaceAll(UnaryOperator<T> operator)

Overrides default java.util.List.replaceAll.

Replaces each element of this list with the result of applying the operator to that element (optional operation).

public void
reverseForEach(Procedure<? super T> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEach.

Evaluates the procedure for each element of the list iterating in reverse order.

public void
reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEachWithIndex.

Evaluates the procedure for each element and it's index in reverse order.

public MutableList<T>
reverseThis()

Overrides default org.eclipse.collections.api.list.MutableList.reverseThis.

Mutates this list by reversing its order and returns the current list as a result.

public MutableList<T>
select(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.select.

Overrides default org.eclipse.collections.api.list.MutableList.select.

Implements org.eclipse.collections.api.collection.MutableCollection.select.

Returns a MutableCollection with all elements that evaluate to true for the specified predicate.

public <S> MutableList<S>
public <P> MutableList<T>
selectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.selectWith.

Overrides default org.eclipse.collections.api.list.MutableList.selectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.selectWith.

Returns a MutableCollection with all elements that evaluate to true for the specified predicate2 and parameter.

public T
set(int index, T element)

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

public MutableList<T>
shuffleThis()

Overrides default org.eclipse.collections.api.list.MutableList.shuffleThis.

Mutates this list by shuffling its elements.

public MutableList<T>
shuffleThis(Random rnd)

Overrides default org.eclipse.collections.api.list.MutableList.shuffleThis.

Mutates this list by shuffling its elements using the specified random.

public void
sort(Comparator<? super T> comparator)

Overrides default java.util.List.sort.

Sorts this list according to the order induced by the specified Comparator (optional operation).

public UnmodifiableMutableList<T>
sortThis(Comparator<? super T> comparator)

Overrides default org.eclipse.collections.api.list.MutableList.sortThis.

Sorts the internal data structure of this list and returns the list itself as a convenience.

public UnmodifiableMutableList<T>
sortThis()

Overrides default org.eclipse.collections.api.list.MutableList.sortThis.

Sorts the internal data structure of this list and returns the list itself as a convenience.

public <V extends Comparable<? super V>> MutableList<T>
sortThisBy(Function<? super T, ? extends V> function)

Overrides default org.eclipse.collections.api.list.MutableList.sortThisBy.

Sorts the internal data structure of this list based on the natural order of the attribute returned by function.

public MutableList<T>
public MutableList<T>
public MutableList<T>
public MutableList<T>
public MutableList<T>
public MutableList<T>
public MutableList<T>
public MutableList<T>
public UnmodifiableMutableList<T>
subList(int fromIndex, int toIndex)

Implements org.eclipse.collections.api.list.MutableList.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

public MutableList<T>
take(int count)

Implements org.eclipse.collections.api.list.MutableList.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public MutableList<T>
takeWhile(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.list.MutableList.takeWhile.

Returns the initial elements that satisfy the Predicate.

public MutableList<T>
tap(Procedure<? super T> procedure)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.tap.

Overrides default org.eclipse.collections.api.list.MutableList.tap.

Implements org.eclipse.collections.api.collection.MutableCollection.tap.

Executes the Procedure for each element in the iterable and returns this.

public ImmutableList<T>
public MutableList<T>
toReversed()

Overrides default org.eclipse.collections.api.list.MutableList.toReversed.

Returns a new MutableList in reverse order.

public MutableList<T>
with(T element)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.with.

Overrides default org.eclipse.collections.api.list.MutableList.with.

Implements org.eclipse.collections.api.collection.MutableCollection.with.

This method allows mutable and fixed size collections the ability to add elements to their existing elements.

public MutableList<T>
withAll(Iterable<? extends T> elements)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.withAll.

Overrides default org.eclipse.collections.api.list.MutableList.withAll.

Implements org.eclipse.collections.api.collection.MutableCollection.withAll.

This method allows mutable and fixed size collections the ability to add multiple elements to their existing elements.

public MutableList<T>
without(T element)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.without.

Overrides default org.eclipse.collections.api.list.MutableList.without.

Implements org.eclipse.collections.api.collection.MutableCollection.without.

This method allows mutable and fixed size collections the ability to remove elements from their existing elements.

public MutableList<T>
withoutAll(Iterable<? extends T> elements)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.withoutAll.

Overrides default org.eclipse.collections.api.list.MutableList.withoutAll.

Implements org.eclipse.collections.api.collection.MutableCollection.withoutAll.

This method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements.

protected Object
public <S> MutableList<Pair<T, S>>
zip(Iterable<S> that)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.zip.

Implements org.eclipse.collections.api.list.MutableList.zip, org.eclipse.collections.api.collection.MutableCollection.zip.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public MutableList<Pair<T, Integer>>
Inherited from org.eclipse.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection:
addaddAlladdAllIterableallSatisfyallSatisfyWithanySatisfyanySatisfyWithappendStringappendStringappendStringasLazychunkclearcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcontainscontainsAllcontainsAllArgumentscontainsAllIterablecontainsAnycontainsAnyIterablecontainsNonecontainsNoneIterablecountcountWithdetectdetectIfNonedetectOptionaldetectWithdetectWithIfNonedetectWithOptionaleachflatCollectflatCollectBooleanflatCollectByteflatCollectCharflatCollectDoubleflatCollectFloatflatCollectIntflatCollectLongflatCollectShortforEachWithforEachWithIndexgetFirstgetLastgetMutableCollectiongetOnlygroupBygroupByEachgroupByUniqueKeygroupByUniqueKeyinjectIntoinjectIntoinjectIntoinjectIntoinjectIntoinjectIntoWithintoisEmptyiteratormakeStringmakeStringmakeStringmaxmaxmaxByminminminBynoneSatisfynoneSatisfyWithnotEmptyrejectrejectWithremoveremoveAllremoveAllIterableremoveIfremoveIfWithretainAllretainAllIterableselectselectAndRejectWithselectWithsizesumByDoublesumByFloatsumByIntsumByLongsumOfDoublesumOfFloatsumOfIntsumOfLongtoArraytoArraytoBagtoBiMaptoListtoMaptoMaptoSettoSortedBagtoSortedBagtoSortedListtoSortedListtoSortedMaptoSortedMaptoSortedMapBytoSortedSettoSortedSettoStringzipzipWithIndex