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> co) |
boolean |
addAll(int index,
Collection<? extends T> co) |
void |
clear()
Clear the FastList.
|
Object |
clone() |
boolean |
contains(Object obj) |
boolean |
containsAll(Collection<?> co) |
void |
forEach(Consumer<? super T> action) |
T |
get(int index)
Get the element at the specified index.
|
int |
indexOf(Object ob) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
int |
lastIndexOf(Object ob) |
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<?> cc) |
boolean |
removeIf(Predicate<? super T> filter) |
T |
removeLast()
Remove the last element from the list.
|
void |
replaceAll(UnaryOperator<T> operator) |
boolean |
retainAll(Collection<?> co) |
T |
set(int index,
T element) |
int |
size()
Get the current number of elements in the FastList.
|
void |
sort(Comparator<? super T> co) |
Spliterator<T> |
spliterator() |
List<T> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<E> E[] |
toArray(E[] ar) |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitparallelStream, streampublic 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 void clear()
public int size()
public boolean isEmpty()
public boolean remove(Object element)
public boolean contains(Object obj)
public Object[] toArray()
public <E> E[] toArray(E[] ar)
public boolean containsAll(Collection<?> co)
containsAll in interface Collection<T>containsAll in interface List<T>public boolean addAll(Collection<? extends T> co)
public boolean addAll(int index,
Collection<? extends T> co)
public boolean removeAll(Collection<?> cc)
public boolean retainAll(Collection<?> co)
public int lastIndexOf(Object ob)
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 Spliterator<T> spliterator()
spliterator in interface Iterable<T>spliterator in interface Collection<T>spliterator in interface List<T>public boolean removeIf(Predicate<? super T> filter)
removeIf in interface Collection<T>public void replaceAll(UnaryOperator<T> operator)
replaceAll in interface List<T>public void sort(Comparator<? super T> co)
Copyright © 2019. All rights reserved.