public class MutableListFactoryImpl extends Object implements MutableListFactory
| Modifier and Type | Field and Description |
|---|---|
static MutableListFactory |
INSTANCE |
| Constructor and Description |
|---|
MutableListFactoryImpl() |
| Modifier and Type | Method and 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 passed
items 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) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitof, of, ofAll, ofInitialCapacity, with, wrapCopypublic static final MutableListFactory INSTANCE
public <T> MutableList<T> empty()
empty in interface MutableListFactorypublic <T> MutableList<T> with(T... items)
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. !!!
with in interface MutableListFactorypublic <T> MutableList<T> withInitialCapacity(int capacity)
withInitialCapacity in interface MutableListFactorypublic <T> MutableList<T> withAll(Iterable<? extends T> iterable)
withAll in interface MutableListFactorypublic <T> MutableList<T> withNValues(int size, Function0<? extends T> factory)
withNValues in interface MutableListFactorypublic <T> MutableList<T> fromStream(Stream<? extends T> stream)
fromStream in interface MutableListFactoryCopyright © 2004–2022. All rights reserved.