Class OnePlusListPlusOne<T>

  • Type Parameters:
    T - Type of the list items.
    All Implemented Interfaces:
    Iterable<T>, Collection<T>, List<T>, RandomAccess

    public final class OnePlusListPlusOne<T>
    extends AbstractList<T>
    implements RandomAccess
    An unmodifiable list that extends another list and includes an additional item at the start and at the end.
    Since:
    8.4.0
    • Constructor Detail

      • OnePlusListPlusOne

        public OnePlusListPlusOne​(T head,
                                  List<T> list,
                                  T tail)
        Constructs a new list that includes the specified start and end items, with the given parent list in between. If the start or end items are null, this will not affect the size, i.e. the resulting list will have a null element at the respective position.
        Parameters:
        head - The item to be placed at the start of the list.
        list - The parent list to be included in the middle.
        tail - The item to be placed at the end of the list.