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

public Interface MutableListFactory

Imports
java.util.stream.Stream, org.eclipse.collections.api.block.function.Function0, org.eclipse.collections.api.list.MutableList

Method Summary

Modifier and TypeMethod and Description
public <T> MutableList<T>
public <T> MutableList<T>
fromStream(Stream<? extends T> stream)

public default <T> MutableList<T>
of()

Same as empty().

public default <T> MutableList<T>
of(T... items)

Same as with(Object[]).

public default <T> MutableList<T>
ofAll(Iterable<? extends T> iterable)

Same as withAll(Iterable).

public default <T> MutableList<T>
ofInitialCapacity(int capacity)

Same as empty().

public default <T> MutableList<T>
with()

Same as empty().

public <T> MutableList<T>
with(T... items)

Creates a new list using the passed items argument as the backing store.

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

public <T> MutableList<T>
withInitialCapacity(int capacity)

Same as empty().

public <T> MutableList<T>
withNValues(int size, Function0<? extends T> factory)

public default <T> MutableList<T>
wrapCopy(T... array)

Creates a new list by first copying the array passed in.

Method Detail

emptyback to summary
public <T> MutableList<T> empty()
Since
6.0
fromStreamback to summary
public <T> MutableList<T> fromStream(Stream<? extends T> stream)
Since
10.0.
ofback to summary
public default <T> MutableList<T> of()

Same as empty().

ofback to summary
public default <T> MutableList<T> of(T... items)

Same as with(Object[]).

ofAllback to summary
public default <T> MutableList<T> ofAll(Iterable<? extends T> iterable)

Same as withAll(Iterable).

ofInitialCapacityback to summary
public default <T> MutableList<T> ofInitialCapacity(int capacity)

Same as empty(). but takes in initial capacity.

withback to summary
public default <T> MutableList<T> with()

Same as empty().

withback to summary
public <T> MutableList<T> with(T... items)

Creates a new list using the passed items argument as the backing store.

!!! WARNING: This method uses the passed in array, so can be very unsafe if the original array is held onto anywhere else.

withAllback to summary
public <T> MutableList<T> withAll(Iterable<? extends T> iterable)
withInitialCapacityback to summary
public <T> MutableList<T> withInitialCapacity(int capacity)

Same as empty(). but takes in initial capacity.

withNValuesback to summary
public <T> MutableList<T> withNValues(int size, Function0<? extends T> factory)
wrapCopyback to summary
public default <T> MutableList<T> wrapCopy(T... array)

Creates a new list by first copying the array passed in.