public class SimpleList<E> extends AbstractList<E> implements Serializable
ArrayList
. The behavior is the
same and performance is almost exactly the same. The major difference is
SimpleList does not perform the same checks on modification as ArrayList, and
will never throw a ConcurrentModificationException
. This means
SimpleList can have unexpected behavior when asked in a multi threaded
environment, but can also be used by multiple threads where an ArrayList
could not be.modCount
Constructor and Description |
---|
SimpleList()
Creates a new SimpleList
|
SimpleList(Collection<? extends E> c)
Creates a new SimpleList
|
SimpleList(int initialCapacity)
Creates a new SimpleList
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
E element) |
E |
get(int index) |
E |
remove(int index) |
E |
set(int index,
E element) |
int |
size() |
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public SimpleList(int initialCapacity)
initialCapacity
- the initial storage size of the listpublic SimpleList()
public SimpleList(Collection<? extends E> c)
c
- the collection of elements to place into the list.Copyright © 2017. All rights reserved.