Class MutableListFactoryImpl
- java.lang.Object
-
- org.eclipse.collections.impl.list.mutable.MutableListFactoryImpl
-
- All Implemented Interfaces:
MutableListFactory
public class MutableListFactoryImpl extends Object implements MutableListFactory
-
-
Field Summary
Fields Modifier and Type Field Description static MutableListFactory
INSTANCE
-
Constructor Summary
Constructors Constructor Description MutableListFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> MutableList<T>
empty()
<T> MutableList<T>
fromStream(Stream<? extends T> stream)
<T> MutableList<T>
with(T... items)
Creates a new list using the passeditems
argument as the backing store.<T> MutableList<T>
withAll(Iterable<? extends T> iterable)
<T> MutableList<T>
withInitialCapacity(int capacity)
<T> MutableList<T>
withNValues(int size, Function0<? extends T> factory)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.factory.list.MutableListFactory
of, of, ofAll, ofInitialCapacity, with, wrapCopy
-
-
-
-
Field Detail
-
INSTANCE
public static final MutableListFactory INSTANCE
-
-
Method Detail
-
empty
public <T> MutableList<T> empty()
- Specified by:
empty
in interfaceMutableListFactory
-
with
public <T> MutableList<T> with(T... items)
Creates a new list using the passeditems
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. !!!
- Specified by:
with
in interfaceMutableListFactory
-
withInitialCapacity
public <T> MutableList<T> withInitialCapacity(int capacity)
- Specified by:
withInitialCapacity
in interfaceMutableListFactory
-
withAll
public <T> MutableList<T> withAll(Iterable<? extends T> iterable)
- Specified by:
withAll
in interfaceMutableListFactory
-
withNValues
public <T> MutableList<T> withNValues(int size, Function0<? extends T> factory)
- Specified by:
withNValues
in interfaceMutableListFactory
-
fromStream
public <T> MutableList<T> fromStream(Stream<? extends T> stream)
- Specified by:
fromStream
in interfaceMutableListFactory
-
-