Documentation of 'jsat.utils.SimpleList' Java class
SimpleList
jsat.utils

Class 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.Serializable
    An alternative implementation of an 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.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      SimpleList()
      Creates a new SimpleList
      SimpleList(java.util.Collection<? extends E> c)
      Creates a new SimpleList
      SimpleList(int initialCapacity)
      Creates a new SimpleList
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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() 
      • 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
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream
      • Methods inherited from interface java.lang.Iterable

        forEach
    • 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.
    • Method Detail

      • get

        public E get(int index)
        Specified by:
        get in interface java.util.List<E>
        Specified by:
        get in class java.util.AbstractList<E>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.List<E>
        Specified by:
        size in class java.util.AbstractCollection<E>
      • add

        public void add(int index,
                        E element)
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.AbstractList<E>
      • remove

        public E remove(int index)
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.AbstractList<E>
      • set

        public E set(int index,
                     E element)
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class java.util.AbstractList<E>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.