| 限定符和类型 | 方法和说明 |
|---|---|
static <E> ArrayList<E> |
newArrayList()
Creates a mutable, empty
ArrayList instance. |
static <E> ArrayList<E> |
newArrayList(E... elements)
Creates a mutable
ArrayList instance containing the given elements. |
static <E> ArrayList<E> |
newArrayList(Iterable<? extends E> elements)
Creates a mutable
ArrayList instance containing the given elements. |
static <E> ArrayList<E> |
newArrayList(Iterator<? extends E> elements)
Creates a mutable
ArrayList instance containing the given elements. |
static <E> ArrayList<E> |
newArrayListWithCapacity(int initialArraySize)
Creates an
ArrayList instance backed by an array of the exact size specified;
equivalent to ArrayList.ArrayList(int). |
static <F,T> List<T> |
transform(List<F> fromList,
Function<? super F,? extends T> function)
Returns a list that applies
function to each element of fromList. |
public static <E> ArrayList<E> newArrayList()
ArrayList instance.public static <E> ArrayList<E> newArrayList(E... elements)
ArrayList instance containing the given elements.public static <E> ArrayList<E> newArrayList(Iterable<? extends E> elements)
ArrayList instance containing the given elements.public static <E> ArrayList<E> newArrayList(Iterator<? extends E> elements)
ArrayList instance containing the given elements.public static <E> ArrayList<E> newArrayListWithCapacity(int initialArraySize)
ArrayList instance backed by an array of the exact size specified;
equivalent to ArrayList.ArrayList(int).public static <F,T> List<T> transform(List<F> fromList, Function<? super F,? extends T> function)
function to each element of fromList.
The returned list is a transformed view of fromList;
changes to fromList will be reflected in the returned list and vice versa.Copyright © 2018. All rights reserved.