public final class FastList<T> extends Object implements List<T>, RandomAccess, Serializable
Constructor and Description |
---|
FastList(Class<?> clazz)
Construct a FastList with a default size of 32.
|
FastList(Class<?> clazz,
int capacity)
Construct a FastList with a specified size.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element) |
boolean |
add(T element)
Add an element to the tail of the FastList.
|
boolean |
addAll(Collection<? extends T> c) |
boolean |
addAll(int index,
Collection<? extends T> c) |
void |
clear()
Clear the FastList.
|
Object |
clone() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
void |
forEach(java.util.function.Consumer<? super T> action) |
T |
get(int index)
Get the element at the specified index.
|
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int index) |
T |
remove(int index) |
boolean |
remove(Object element)
This remove method is most efficient when the element being removed
is the last element.
|
boolean |
removeAll(Collection<?> c) |
boolean |
removeIf(java.util.function.Predicate<? super T> filter) |
T |
removeLast()
Remove the last element from the list.
|
void |
replaceAll(java.util.function.UnaryOperator<T> operator) |
boolean |
retainAll(Collection<?> c) |
T |
set(int index,
T element) |
int |
size()
Get the current number of elements in the FastList.
|
void |
sort(Comparator<? super T> c) |
Spliterator<T> |
spliterator() |
List<T> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parallelStream, stream
public FastList(Class<?> clazz)
clazz
- the Class stored in the collectionpublic FastList(Class<?> clazz, int capacity)
clazz
- the Class stored in the collectioncapacity
- the initial size of the FastListpublic boolean add(T element)
public T get(int index)
public T removeLast()
public boolean remove(Object element)
public void clear()
public int size()
public boolean isEmpty()
public boolean contains(Object o)
public Object[] toArray()
public <E> E[] toArray(E[] a)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T>
containsAll
in interface List<T>
public boolean addAll(Collection<? extends T> c)
public boolean addAll(int index, Collection<? extends T> c)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public int lastIndexOf(Object o)
lastIndexOf
in interface List<T>
public ListIterator<T> listIterator()
listIterator
in interface List<T>
public ListIterator<T> listIterator(int index)
listIterator
in interface List<T>
public void forEach(java.util.function.Consumer<? super T> action)
public Spliterator<T> spliterator()
spliterator
in interface Iterable<T>
spliterator
in interface Collection<T>
spliterator
in interface List<T>
public boolean removeIf(java.util.function.Predicate<? super T> filter)
removeIf
in interface Collection<T>
public void replaceAll(java.util.function.UnaryOperator<T> operator)
replaceAll
in interface List<T>
public void sort(Comparator<? super T> c)
Copyright © 2016 Zaxxer.com. All Rights Reserved.