public class SimpleArrayList<T> extends Object implements List<T>
Minimal checks for data correctness!! This is tuned for speed not elegance or safety.
| Constructor and Description |
|---|
SimpleArrayList()
Create a new list with a default capacity.
|
SimpleArrayList(int capacity)
Create a new list with a default capacity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
add(T element)
Add an element to the end of the list
|
boolean |
addAll(Collection<? extends T> c) |
boolean |
addAll(int index,
Collection<? extends T> c) |
void |
clear()
Clears the list by setting the size to zero.
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
T |
get(int index)
Return an element at index.
|
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int index) |
List<List<T>> |
partition(int count)
Returns view partitions on the underlying list.
|
T |
remove(int index)
Removes the data at index and shifts all data right of it
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
T |
set(int index,
T element) |
int |
size()
Returns the size of this list
|
List<T> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray()
Creates an array of the elements.
|
<T> T[] |
toArray(T[] array)
Creates an array of the elements.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCode, replaceAll, sort, spliteratorparallelStream, removeIf, streampublic SimpleArrayList(int capacity)
capacity - the capacitypublic SimpleArrayList()
public boolean add(T element)
public T get(int index)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] array)
public void clear()
public List<List<T>> partition(int count)
count - how many list do we wantpublic boolean isEmpty()
public boolean contains(Object o)
public boolean remove(Object o)
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 T remove(int index)
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>Copyright © 2024 HtmlUnit. All rights reserved.