Package jmri.util

Class NonNullArrayList<E>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess

    public class NonNullArrayList<E>
    extends java.util.ArrayList<E>
    An ArrayList that SpotBugs understands will never contain null elements.
    See Also:
    ArrayList, List, Serialized Form
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int i, E e)  
      boolean add​(E e)  
      boolean addAll​(int i, java.util.Collection<? extends E> c)  
      boolean addAll​(java.util.Collection<? extends E> c)  
      protected boolean asArgumentCheck​(NonNullArrayList<java.lang.Integer> t)  
      E get​(int i)  
      E remove​(int i)  
      E set​(int i, E e)  
      protected NonNullArrayList<java.lang.Integer> testAddAndReturn()  
      protected boolean testLoop​(java.lang.String c)  
      • Methods inherited from class java.util.ArrayList

        clear, clone, contains, ensureCapacity, equals, forEach, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

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

        parallelStream, stream, toArray
      • Methods inherited from interface java.util.List

        containsAll
    • Method Detail

      • add

        public boolean add​(@Nonnull
                           E e)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.ArrayList<E>
      • add

        public void add​(int i,
                        @Nonnull
                        E e)
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.ArrayList<E>
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> c)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.ArrayList<E>
      • addAll

        public boolean addAll​(int i,
                              java.util.Collection<? extends E> c)
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.ArrayList<E>
      • get

        @Nonnull
        public E get​(int i)
        Specified by:
        get in interface java.util.List<E>
        Overrides:
        get in class java.util.ArrayList<E>
      • remove

        @Nonnull
        public E remove​(int i)
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.ArrayList<E>
      • set

        @Nonnull
        public E set​(int i,
                     @Nonnull
                     E e)
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class java.util.ArrayList<E>
      • testLoop

        protected boolean testLoop​(java.lang.String c)