Class TailList<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
net.hydromatic.morel.util.TailList<E>
Type Parameters:
E - Element type
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>

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

    • list

      private final List<E> list
    • start

      private final int start
  • Constructor Details

    • 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.

  • Method Details