jsat.utils
Class SimpleList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- jsat.utils.SimpleList<E>
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>
public class SimpleList<E> extends java.util.AbstractList<E> implements java.io.SerializableAn alternative implementation of anArrayList. 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 aConcurrentModificationException. 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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SimpleList()Creates a new SimpleListSimpleList(java.util.Collection<? extends E> c)Creates a new SimpleListSimpleList(int initialCapacity)Creates a new SimpleList
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(int index, E element)Eget(int index)Eremove(int index)Eset(int index, E element)intsize()-
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
SimpleList
public SimpleList(int initialCapacity)
Creates a new SimpleList- Parameters:
initialCapacity- the initial storage size of the list
-
SimpleList
public SimpleList()
Creates a new SimpleList
-
SimpleList
public SimpleList(java.util.Collection<? extends E> c)
Creates a new SimpleList- Parameters:
c- the collection of elements to place into the list.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG