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 MutableListFactoryINSTANCE
-
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 passeditemsargument 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:
emptyin interfaceMutableListFactory
-
with
public <T> MutableList<T> with(T... items)
Creates a new list using the passeditemsargument 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:
within interfaceMutableListFactory
-
withInitialCapacity
public <T> MutableList<T> withInitialCapacity(int capacity)
- Specified by:
withInitialCapacityin interfaceMutableListFactory
-
withAll
public <T> MutableList<T> withAll(Iterable<? extends T> iterable)
- Specified by:
withAllin interfaceMutableListFactory
-
withNValues
public <T> MutableList<T> withNValues(int size, Function0<? extends T> factory)
- Specified by:
withNValuesin interfaceMutableListFactory
-
fromStream
public <T> MutableList<T> fromStream(Stream<? extends T> stream)
- Specified by:
fromStreamin interfaceMutableListFactory
-
-