Class AbstractUnmodifiableList<E>

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

    public abstract class AbstractUnmodifiableList<E>
    extends java.util.AbstractList<E>
    A subclass of AbstractList that overrides the various mutator methods to mark them as deprecated and unconditionally throw UnsupportedOperationException.
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void add​(int index, E element)
      Deprecated.
      Unsupported operation.
      boolean add​(E e)
      Deprecated.
      Unsupported operation.
      boolean addAll​(int index, java.util.Collection<? extends E> c)
      Deprecated.
      Unsupported operation.
      boolean addAll​(java.util.Collection<? extends E> c)
      Deprecated.
      Unsupported operation.
      void clear()
      Deprecated.
      Unsupported operation.
      E remove​(int index)
      Deprecated.
      Unsupported operation.
      boolean remove​(java.lang.Object o)
      Deprecated.
      Unsupported operation.
      boolean removeAll​(java.util.Collection<?> c)
      Deprecated.
      Unsupported operation.
      boolean removeIf​(java.util.function.Predicate<? super E> filter)
      Deprecated.
      Unsupported operation.
      void replaceAll​(java.util.function.UnaryOperator<E> operator)
      Deprecated.
      Unsupported operation.
      boolean retainAll​(java.util.Collection<?> list)
      Deprecated.
      Unsupported operation.
      E set​(int index, E element)
      Deprecated.
      Unsupported operation.
      void sort​(java.util.Comparator<? super E> c)
      Deprecated.
      Unsupported operation.
      • Methods inherited from class java.util.AbstractList

        equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        contains, containsAll, isEmpty, size, 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, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        contains, containsAll, isEmpty, size, spliterator, toArray, toArray
    • Constructor Detail

      • AbstractUnmodifiableList

        public AbstractUnmodifiableList()
    • Method Detail

      • add

        @Deprecated
        public boolean add​(E e)
        Deprecated.
        Unsupported operation.
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.AbstractList<E>
        Throws:
        java.lang.UnsupportedOperationException - always
      • add

        @Deprecated
        public void add​(int index,
                        E element)
        Deprecated.
        Unsupported operation.
        Specified by:
        add in interface java.util.List<E>
        Overrides:
        add in class java.util.AbstractList<E>
        Throws:
        java.lang.UnsupportedOperationException - always
      • addAll

        @Deprecated
        public boolean addAll​(java.util.Collection<? extends E> c)
        Deprecated.
        Unsupported operation.
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.AbstractCollection<E>
        Throws:
        java.lang.UnsupportedOperationException - always
      • addAll

        @Deprecated
        public boolean addAll​(int index,
                              java.util.Collection<? extends E> c)
        Deprecated.
        Unsupported operation.
        Specified by:
        addAll in interface java.util.List<E>
        Overrides:
        addAll in class java.util.AbstractList<E>
        Throws:
        java.lang.UnsupportedOperationException - always
      • clear

        @Deprecated
        public void clear()
        Deprecated.
        Unsupported operation.
        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>
        Throws:
        java.lang.UnsupportedOperationException - always
      • remove

        @Deprecated
        public E remove​(int index)
        Deprecated.
        Unsupported operation.
        Specified by:
        remove in interface java.util.List<E>
        Overrides:
        remove in class java.util.AbstractList<E>
        Throws:
        java.lang.UnsupportedOperationException - always
      • remove

        @Deprecated
        public boolean remove​(java.lang.Object o)
        Deprecated.
        Unsupported operation.
        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>
        Throws:
        java.lang.UnsupportedOperationException - always
      • removeAll

        @Deprecated
        public boolean removeAll​(java.util.Collection<?> c)
        Deprecated.
        Unsupported operation.
        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>
        Throws:
        java.lang.UnsupportedOperationException - always
      • removeIf

        @Deprecated
        public boolean removeIf​(java.util.function.Predicate<? super E> filter)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • replaceAll

        @Deprecated
        public void replaceAll​(java.util.function.UnaryOperator<E> operator)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always
      • retainAll

        @Deprecated
        public boolean retainAll​(java.util.Collection<?> list)
        Deprecated.
        Unsupported operation.
        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>
        Throws:
        java.lang.UnsupportedOperationException - always
      • set

        @Deprecated
        public E set​(int index,
                     E element)
        Deprecated.
        Unsupported operation.
        Specified by:
        set in interface java.util.List<E>
        Overrides:
        set in class java.util.AbstractList<E>
        Throws:
        java.lang.UnsupportedOperationException - always
      • sort

        @Deprecated
        public void sort​(java.util.Comparator<? super E> c)
        Deprecated.
        Unsupported operation.
        Throws:
        java.lang.UnsupportedOperationException - always