Class TailList<E>

  • Type Parameters:
    E - Element type
    All Implemented Interfaces:
    Iterable<E>, Collection<E>, List<E>

    public class TailList<E>
    extends AbstractList<E>
    A dynamic list that reads from a given point in a backing list.
    • Field Detail

      • list

        private final List<E> list
      • start

        private final int start
    • Constructor Detail

      • TailList

        public TailList​(List<E> list,
                        int start)
        Creates a list that reads elements from a given backing list after a given start point.
        Parameters:
        list - Backing list
        start - Start point
      • TailList

        public TailList​(List<E> list)
        Creates a list whose start is the current size of the backing list.

        Thus only elements appended to the backing list after creation will appear in this list.