public class ListBuilder<T> extends AbstractList<T> implements RandomAccess, Serializable
Notes:
modCount| Constructor and Description |
|---|
ListBuilder(int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
add(T t) |
boolean |
addAll(Collection<? extends T> c) |
boolean |
addAll(int index,
Collection<? extends T> c) |
boolean |
addAll(int index,
ListBuilder<? extends T> c) |
boolean |
addAll(ListBuilder<? extends T> c) |
ListBuilder<T> |
append(Collection<? extends T> col) |
ListBuilder<T> |
append(Collection<? extends T> c1,
Collection<? extends T> c2) |
ListBuilder<T> |
append(Collection<? extends T> c1,
Collection<? extends T> c2,
Collection<? extends T>... ca) |
ListBuilder<T> |
append(Enumeration<? extends T> enumeration) |
ListBuilder<T> |
append(Iterable<? extends T> iterable) |
ListBuilder<T> |
append(Iterator<? extends T> iterator) |
ListBuilder<T> |
append(Object[] ta) |
ListBuilder<T> |
append(Object[] ta1,
Object[] ta2) |
ListBuilder<T> |
append(Object[] ta1,
Object[] ta2,
Object[]... taa) |
ListBuilder<T> |
append(T t) |
ListBuilder<T> |
append(T t1,
T t2) |
ListBuilder<T> |
append(T t1,
T t2,
T t3) |
ListBuilder<T> |
append(T t1,
T t2,
T t3,
T t4) |
ListBuilder<T> |
append(T t1,
T t2,
T t3,
T t4,
T t5) |
ListBuilder<T> |
append(T t1,
T t2,
T t3,
T t4,
T t5,
T... ta) |
void |
clear() |
static <T> ListBuilder<T> |
create()
Create an empty ListBuilder instance
|
static <T> ListBuilder<T> |
create(int initialCapacity) |
T |
get(int index) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
C.List<T> |
toList()
Return an immutable list contains all element of this list builder
and then release references to the internal buffer.
|
static <T> C.List<T> |
toList(Collection<? extends T> col)
Returns an immutable
C.List from a collection |
static <T> C.List<T> |
toList(Enumeration<? extends T> enumeration) |
static <T> C.List<T> |
toList(Iterable<? extends T> iterable)
Returns an immutable
C.List from iterable |
static <T> C.List<T> |
toList(Iterator<? extends T> iterator)
Returns an immutable
C.List from an iterator |
C.Set<T> |
toSet() |
equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListcontains, containsAll, isEmpty, remove, removeAll, retainAll, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliteratorparallelStream, removeIf, streampublic int size()
size in interface Collection<T>size in interface List<T>size in class AbstractCollection<T>public T get(int index)
public boolean add(T t)
add in interface Collection<T>add in interface List<T>add in class AbstractList<T>public void add(int index,
T element)
public Object[] toArray()
toArray in interface Collection<T>toArray in interface List<T>toArray in class AbstractCollection<T>public <T> T[] toArray(T[] a)
toArray in interface Collection<T>toArray in interface List<T>toArray in class AbstractCollection<T>public boolean addAll(Collection<? extends T> c)
addAll in interface Collection<T>addAll in interface List<T>addAll in class AbstractCollection<T>public boolean addAll(ListBuilder<? extends T> c)
public boolean addAll(int index,
ListBuilder<? extends T> c)
public boolean addAll(int index,
Collection<? extends T> c)
public void clear()
clear in interface Collection<T>clear in interface List<T>clear in class AbstractList<T>public ListBuilder<T> append(T t)
public ListBuilder<T> append(Object[] ta)
public ListBuilder<T> append(Object[] ta1, Object[] ta2)
public ListBuilder<T> append(Object[] ta1, Object[] ta2, Object[]... taa)
public ListBuilder<T> append(T t1, T t2)
public ListBuilder<T> append(T t1, T t2, T t3)
public ListBuilder<T> append(Collection<? extends T> col)
public ListBuilder<T> append(Collection<? extends T> c1, Collection<? extends T> c2)
public ListBuilder<T> append(Collection<? extends T> c1, Collection<? extends T> c2, Collection<? extends T>... ca)
public ListBuilder<T> append(Iterable<? extends T> iterable)
public ListBuilder<T> append(Iterator<? extends T> iterator)
public ListBuilder<T> append(Enumeration<? extends T> enumeration)
public C.List<T> toList()
IllegalStateExceptionpublic static <T> C.List<T> toList(Iterable<? extends T> iterable)
C.List from iterableT - the element typeiterable - the iterablepublic static <T> C.List<T> toList(Iterator<? extends T> iterator)
C.List from an iteratorT - the element typeiterator - the iteratorpublic static <T> C.List<T> toList(Enumeration<? extends T> enumeration)
public static <T> C.List<T> toList(Collection<? extends T> col)
C.List from a collectionT - element typecol - the collection specifiedpublic static <T> ListBuilder<T> create()
T - the type of the element in the builderpublic static <T> ListBuilder<T> create(int initialCapacity)
Copyright © 2017. All Rights Reserved.