Class ImmutableList<E>

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

    public class ImmutableList<E>
    extends java.util.AbstractList<E>
    implements java.util.RandomAccess
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ImmutableList​(E... elements)  
      protected ImmutableList​(java.util.Collection<? extends E> elements)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      E get​(int index)  
      java.util.Iterator<E> iterator()  
      java.util.ListIterator<E> listIterator​(int index)  
      static <E> ImmutableList<E> newInstance​(E... elements)  
      static <E> ImmutableList<E> newInstance​(java.util.Collection<? extends E> elements)  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> clctn)  
      boolean retainAll​(java.util.Collection<?> c)  
      int size()  
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, remove, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, 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, replaceAll, sort, spliterator, toArray, toArray
    • Constructor Detail

      • ImmutableList

        protected ImmutableList​(E... elements)
      • ImmutableList

        protected ImmutableList​(java.util.Collection<? extends E> elements)
    • Method Detail

      • newInstance

        public static <E> ImmutableList<E> newInstance​(E... elements)
      • newInstance

        public static <E> ImmutableList<E> newInstance​(java.util.Collection<? extends E> elements)
      • 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>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<E>
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.AbstractCollection<E>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> clctn)
        Specified by:
        removeAll in interface java.util.Collection<E>
        Specified by:
        removeAll in interface java.util.List<E>
        Overrides:
        removeAll 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>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<E>
        Specified by:
        retainAll in interface java.util.List<E>
        Overrides:
        retainAll in class java.util.AbstractCollection<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.List<E>
        Overrides:
        iterator in class java.util.AbstractList<E>
      • listIterator

        public java.util.ListIterator<E> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<E>
        Overrides:
        listIterator in class java.util.AbstractList<E>