Type Parameters:
E - element class.
All Superinterfaces:
Collection<E>, Iterable<E>, SmartCollection<E>
All Known Implementing Classes:
AbstractLinkedList, DefaultLinkedList, IntrusiveLinkedList

public interface SmartSequence<E> extends SmartCollection<E>
Sequence interface. A sequence is a collection where elements are stored in a specific order, and elements can be inserted in between.
  • Method Details

    • pred

      Retrieves the reference to the preceding element, or null if the given reference references the first element in the list.
      Parameters:
      ref - the reference
      Returns:
      the reference to the preceding element
    • succ

      Retrieves the reference to the succeeding element, or null if the given reference references the last element in the list.
      Parameters:
      ref - the reference
      Returns:
      the reference to the succeeding element
    • insertBefore

      ElementReference insertBefore(E element, ElementReference ref)
      Inserts the given element before the element referenced by the specified reference.
      Parameters:
      element - the element to be added.
      ref - reference to the element before which the new element is to be inserted.
      Returns:
      reference to the newly added element.
    • insertAfter

      ElementReference insertAfter(E element, ElementReference ref)
      Inserts the given element after the element referenced by the specified reference.
      Parameters:
      element - the element to be added.
      ref - reference to the element after which the new element is to be inserted.
      Returns:
      reference to the newly added element.