Class ReadOnlyListFacade<E>

Type Parameters:
E - the element type
All Implemented Interfaces:
Iterable<E>, ReadOnlyCollection<E>, ReadOnlyList<E>, ReadOnlySequencedCollection<E>

public class ReadOnlyListFacade<E> extends AbstractReadOnlyList<E>
Provides a ReadOnlyList facade to a set of ReadOnlyList functions.
Author:
Werner Randelshofer
  • Constructor Details

  • Method Details

    • get

      public E get(int index)
      Description copied from interface: ReadOnlyList
      Returns the element at the specified position in this list.
      Parameters:
      index - the index of the element
      Returns:
      the element
    • readOnlyReversed

      public @NonNull ReadOnlySequencedCollection<E> readOnlyReversed()
      Description copied from interface: ReadOnlySequencedCollection
      Returns a reversed-order view of this collection. Changes to the underlying collection are visible in the reversed view.
      Returns:
      a reversed-order view of this collection
    • readOnlySubList

      public @NonNull ReadOnlyList<E> readOnlySubList(int fromIndex, int toIndex)
      Description copied from interface: ReadOnlyList
      Returns a view of the portion of this list between the specified * fromIndex, inclusive, and toIndex, exclusive.
      Parameters:
      fromIndex - the from index
      toIndex - the to index (exclusive)
      Returns:
      the sub list
    • size

      public int size()
      Description copied from interface: ReadOnlyCollection
      Returns the size of the collection.
      Returns:
      the size