Class NonNullList<E>

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

    public class NonNullList<E>
    extends java.util.AbstractList<E>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private E defaultValue  
      private java.util.List<E> list  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected NonNullList()  
      protected NonNullList​(java.util.List<E> p_i47327_1_, E p_i47327_2_)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int p_add_1_, E p_add_2_)  
      void clear()  
      static <E> NonNullList<E> create()  
      E get​(int p_get_1_)  
      static <E> NonNullList<E> of​(E p_193580_0_, E... p_193580_1_)  
      E remove​(int p_remove_1_)  
      E set​(int p_set_1_, E p_set_2_)  
      int size()  
      static <E> NonNullList<E> withSize​(int p_191197_0_, E p_191197_1_)  
      • Methods inherited from class java.util.AbstractList

        add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, 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

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

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

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Field Detail

      • list

        private final java.util.List<E> list
      • defaultValue

        private final E defaultValue
    • Constructor Detail

      • NonNullList

        protected NonNullList()
      • NonNullList

        protected NonNullList​(java.util.List<E> p_i47327_1_,
                              @Nullable
                              E p_i47327_2_)
    • Method Detail

      • withSize

        public static <E> NonNullList<E> withSize​(int p_191197_0_,
                                                  E p_191197_1_)
      • of

        @SafeVarargs
        public static <E> NonNullList<E> of​(E p_193580_0_,
                                            E... p_193580_1_)
      • get

        @Nonnull
        public E get​(int p_get_1_)
        Specified by:
        get in interface java.util.List<E>
        Specified by:
        get in class java.util.AbstractList<E>
      • set

        public E set​(int p_set_1_,
                     E p_set_2_)
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class java.util.AbstractList<E>
      • add

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

        public E remove​(int p_remove_1_)
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove 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>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.List<E>
        Overrides:
        clear in class java.util.AbstractList<E>