Class AbstractListDecorator<E>

  • Type Parameters:
    E - the type of the elements in the list
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>
    Direct Known Subclasses:
    AbstractSerializableListDecorator

    public abstract class AbstractListDecorator<E>
    extends AbstractCollectionDecorator<E>
    implements java.util.List<E>
    Decorates another List to provide additional behaviour.

    Methods are forwarded directly to the decorated list.

    Since:
    3.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractListDecorator()
      Constructor only used in deserialization, do not use otherwise.
      protected AbstractListDecorator​(java.util.List<E> list)
      Constructor that wraps (not copies).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, E object)  
      boolean addAll​(int index, java.util.Collection<? extends E> coll)  
      protected java.util.List<E> decorated()
      Gets the list being decorated.
      boolean equals​(java.lang.Object object)  
      E get​(int index)  
      int hashCode()  
      int indexOf​(java.lang.Object object)  
      int lastIndexOf​(java.lang.Object object)  
      java.util.ListIterator<E> listIterator()  
      java.util.ListIterator<E> listIterator​(int index)  
      E remove​(int index)  
      E set​(int index, E object)  
      java.util.List<E> subList​(int fromIndex, int toIndex)  
      • 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

        add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArray
    • Constructor Detail

      • AbstractListDecorator

        protected AbstractListDecorator()
        Constructor only used in deserialization, do not use otherwise.
        Since:
        3.1
      • AbstractListDecorator

        protected AbstractListDecorator​(java.util.List<E> list)
        Constructor that wraps (not copies).
        Parameters:
        list - the list to decorate, must not be null
        Throws:
        java.lang.NullPointerException - if list is null
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object object)
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.List<E>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.List<E>
        Overrides:
        hashCode in class java.lang.Object
      • add

        public void add​(int index,
                        E object)
        Specified by:
        add in interface java.util.List<E>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends E> coll)
        Specified by:
        addAll in interface java.util.List<E>
      • get

        public E get​(int index)
        Specified by:
        get in interface java.util.List<E>
      • indexOf

        public int indexOf​(java.lang.Object object)
        Specified by:
        indexOf in interface java.util.List<E>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object object)
        Specified by:
        lastIndexOf in interface java.util.List<E>
      • listIterator

        public java.util.ListIterator<E> listIterator()
        Specified by:
        listIterator in interface java.util.List<E>
      • listIterator

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

        public E remove​(int index)
        Specified by:
        remove in interface java.util.List<E>
      • set

        public E set​(int index,
                     E object)
        Specified by:
        set in interface java.util.List<E>
      • subList

        public java.util.List<E> subList​(int fromIndex,
                                         int toIndex)
        Specified by:
        subList in interface java.util.List<E>