Class FixedSizeList<T>

  • Type Parameters:
    T - The type of the item that this list contains
    All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>

    public abstract class FixedSizeList<T>
    extends java.util.AbstractList<T>
    This provides a thin facade over AbstractList, to take care of bounds checking.
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      FixedSizeList()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      T get​(int index)  
      abstract T readItem​(int index)
      Reads the item at index
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, 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, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

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

      • FixedSizeList

        public FixedSizeList()
    • Method Detail

      • get

        public T get​(int index)
        Specified by:
        get in interface java.util.List<T>
        Specified by:
        get in class java.util.AbstractList<T>
      • readItem

        @Nonnull
        public abstract T readItem​(int index)
        Reads the item at index
        Parameters:
        index - The index of the item. This is guaranteed to be in [0, size)
        Returns:
        The item at the given index