Class UnmodifiableList<E>

    • Constructor Detail

      • UnmodifiableList

        public UnmodifiableList(List<? extends E> list)
        Constructor that wraps (not copies).
        Parameters:
        list - the list to decorate, must not be null
        Throws:
        NullPointerException - if list is null
    • Method Detail

      • unmodifiableList

        public static <E> List<E> unmodifiableList(List<? extends E> list)
        Factory method to create an unmodifiable list.
        Type Parameters:
        E - the type of the elements in the list
        Parameters:
        list - the list to decorate, must not be null
        Returns:
        a new unmodifiable list
        Throws:
        NullPointerException - if list is null
        Since:
        4.0
      • add

        public boolean add(Object object)
      • addAll

        public boolean addAll(Collection<? extends E> coll)
      • clear

        public void clear()
      • remove

        public boolean remove(Object object)
      • removeAll

        public boolean removeAll(Collection<?> coll)
      • retainAll

        public boolean retainAll(Collection<?> coll)
      • add

        public void add(int index,
                        E object)
      • addAll

        public boolean addAll(int index,
                              Collection<? extends E> coll)
      • remove

        public E remove(int index)
      • set

        public E set(int index,
                     E object)
      • subList

        public List<E> subList(int fromIndex,
                               int toIndex)