Interface DoublyLinkedList<T>

  • Type Parameters:
    T - doubly linked list item
    All Superinterfaces:
    java.util.Collection<T>, java.lang.Iterable<T>, java.util.List<T>
    All Known Implementing Classes:
    DefaultDoublyLinkedList

    @ParametersAreNonnullByDefault
    public interface DoublyLinkedList<T>
    extends java.util.List<T>
    Doubly linked list of items.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T first()
      Returns first item of the list.
      T last()
      Returns last item of the list.
      T nextTo​(T item)
      Returns item next to given item.
      T prevTo​(T item)
      Returns item previous to given item.
      • 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

        add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
    • Method Detail

      • first

        @Nullable
        T first()
        Returns first item of the list.
        Returns:
        first item
      • last

        @Nullable
        T last()
        Returns last item of the list.
        Returns:
        last item
      • nextTo

        @Nullable
        T nextTo​(T item)
        Returns item next to given item.
        Parameters:
        item - item
        Returns:
        next item or null
      • prevTo

        @Nullable
        T prevTo​(T item)
        Returns item previous to given item.
        Parameters:
        item - item
        Returns:
        previous item or null