Top Description Methods
org.eclipse.collections.api.list

public Interface MultiReaderList<T>

extends MutableList<T>
Imports
java.util.Comparator, .Random, org.eclipse.collections.api.block.function.Function, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ShortFunction, org.eclipse.collections.api.block.procedure.Procedure

A MultiReaderList provides thread-safe iteration for a list through methods withReadLockAndDelegate() and withWriteLockAndDelegate().
Since
10.0.

Method Summary

Modifier and TypeMethod and Description
public MultiReaderList<T>
public MultiReaderList<T>
newEmpty()

Redeclares org.eclipse.collections.api.list.MutableList.newEmpty.

Creates a new empty mutable version of the same collection type.

public MultiReaderList<T>
reverseThis()

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.reverseThis.

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

public MultiReaderList<T>
shuffleThis()

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.shuffleThis.

Mutates this list by shuffling its elements.

public MultiReaderList<T>
shuffleThis(Random random)

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.shuffleThis.

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

public default MultiReaderList<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 default MultiReaderList<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>> MultiReaderList<T>
sortThisBy(Function<? super T, ? extends V> function)

Redeclares as abstract: 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 MultiReaderList<T>
public MultiReaderList<T>
public MultiReaderList<T>
public MultiReaderList<T>
public MultiReaderList<T>
public MultiReaderList<T>
public MultiReaderList<T>
public MultiReaderList<T>
public MultiReaderList<T>
subList(int fromIndex, int toIndex)

Redeclares 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 default MultiReaderList<T>
tap(Procedure<? super T> procedure)

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

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

public default MultiReaderList<T>
with(T element)

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

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

public default MultiReaderList<T>
withAll(Iterable<? extends T> elements)

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

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

public default MultiReaderList<T>
without(T element)

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

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

public default MultiReaderList<T>
withoutAll(Iterable<? extends T> elements)

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

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

public void
public void
Inherited from org.eclipse.collections.api.list.MutableList:
asSynchronizedasUnmodifiablecollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcollectWithIndexdistinctdistinctdistinctBydropdropWhileflatCollectflatCollectWithgetFirstgetLastgroupBygroupByEachindexOfpartitionpartitionWhilepartitionWithrejectrejectWithrejectWithIndexselectselectInstancesOfselectWithselectWithIndextaketakeWhiletoArraytoArraytoImmutabletoImmutableListtoReversedzipzipWithIndex

Method Detail

cloneback to summary
public MultiReaderList<T> clone()

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

Annotations
@Override
newEmptyback to summary
public MultiReaderList<T> newEmpty()

Redeclares org.eclipse.collections.api.list.MutableList.newEmpty.

Doc from org.eclipse.collections.api.collection.MutableCollection.newEmpty.

Creates a new empty mutable version of the same collection type. For example, if this instance is a FastList, this method will return a new empty FastList. If the class of this instance is immutable or fixed size (i.e. SingletonList) then a mutable alternative to the class will be provided.

Annotations
@Override
reverseThisback to summary
public MultiReaderList<T> reverseThis()

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.reverseThis.

Doc from org.eclipse.collections.api.list.MutableList.reverseThis.

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

Annotations
@Override
shuffleThisback to summary
public MultiReaderList<T> shuffleThis()

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.shuffleThis.

Doc from org.eclipse.collections.api.list.MutableList.shuffleThis.

Mutates this list by shuffling its elements.

Annotations
@Override
shuffleThisback to summary
public MultiReaderList<T> shuffleThis(Random random)

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.shuffleThis.

Doc from org.eclipse.collections.api.list.MutableList.shuffleThis.

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

Annotations
@Override
sortThisback to summary
public default MultiReaderList<T> sortThis(Comparator<? super T> comparator)

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

Doc from org.eclipse.collections.api.list.MutableList.sortThis.

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

Annotations
@Override
sortThisback to summary
public default MultiReaderList<T> sortThis()

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

Doc from org.eclipse.collections.api.list.MutableList.sortThis.

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

Annotations
@Override
sortThisByback to summary
public <V extends Comparable<? super V>> MultiReaderList<T> sortThisBy(Function<? super T, ? extends V> function)

Redeclares as abstract: org.eclipse.collections.api.list.MutableList.sortThisBy.

Doc from 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.

Annotations
@Override
sortThisByBooleanback to summary
public MultiReaderList<T> sortThisByBoolean(BooleanFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByBoolean.

Annotations
@Override
sortThisByByteback to summary
public MultiReaderList<T> sortThisByByte(ByteFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByByte.

Annotations
@Override
sortThisByCharback to summary
public MultiReaderList<T> sortThisByChar(CharFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByChar.

Annotations
@Override
sortThisByDoubleback to summary
public MultiReaderList<T> sortThisByDouble(DoubleFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByDouble.

Annotations
@Override
sortThisByFloatback to summary
public MultiReaderList<T> sortThisByFloat(FloatFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByFloat.

Annotations
@Override
sortThisByIntback to summary
public MultiReaderList<T> sortThisByInt(IntFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByInt.

Annotations
@Override
sortThisByLongback to summary
public MultiReaderList<T> sortThisByLong(LongFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByLong.

Annotations
@Override
sortThisByShortback to summary
public MultiReaderList<T> sortThisByShort(ShortFunction<? super T> function)

Redeclares org.eclipse.collections.api.list.MutableList.sortThisByShort.

Annotations
@Override
subListback to summary
public MultiReaderList<T> subList(int fromIndex, int toIndex)

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

Doc from java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:

list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Annotations
@Override
tapback to summary
public default MultiReaderList<T> tap(Procedure<? super T> procedure)

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

Doc from org.eclipse.collections.api.RichIterable.tap.

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

Example using a Java 8 lambda expression:

RichIterable<Person> tapped =
    people.tap(person -> LOGGER.info(person.getName()));
Annotations
@Override
withback to summary
public default MultiReaderList<T> with(T element)

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

Doc from org.eclipse.collections.api.collection.MutableCollection.with.

This method allows mutable and fixed size collections the ability to add elements to their existing elements. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new element to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list = list.with("1");
list = list.with("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by with, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling add on itself.
Annotations
@Override
withAllback to summary
public default MultiReaderList<T> withAll(Iterable<? extends T> elements)

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

Doc from 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. In order to support fixed size a new instance of a collection would have to be returned taking the elements of the original collection and appending the new elements to form the new collection. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list = list.withAll(FastList.newListWith("1", "2"));
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withAll, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling addAll on itself.
Annotations
@Override
withoutback to summary
public default MultiReaderList<T> without(T element)

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

Doc from org.eclipse.collections.api.collection.MutableCollection.without.

This method allows mutable and fixed size collections the ability to remove elements from their existing elements. In order to support fixed size a new instance of a collection would have to be returned containing the elements that would be left from the original collection after calling remove. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list = list.without("1");
list = list.without("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by without, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling remove on itself.
Annotations
@Override
withoutAllback to summary
public default MultiReaderList<T> withoutAll(Iterable<? extends T> elements)

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

Doc from 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. In order to support fixed size a new instance of a collection would have to be returned containing the elements that would be left from the original collection after calling removeAll. In the case of mutable collections, the original collection is modified, and is returned. In order to use this method properly with mutable and fixed size collections the following approach must be taken:

MutableCollection<String> list = list.withoutAll(FastList.newListWith("1", "2"));
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withoutAll, and any variables that previously referenced the original collection will need to be redirected to reference the new instance. For other MutableCollection types you will replace the reference to collection with the same collection, since the instance will return "this" after calling removeAll on itself.
Annotations
@Override
withReadLockAndDelegateback to summary
public void withReadLockAndDelegate(Procedure<? super MutableList<T>> procedure)
withWriteLockAndDelegateback to summary
public void withWriteLockAndDelegate(Procedure<? super MutableList<T>> procedure)