Interface PSequence<E>

Type Parameters:
E -
All Superinterfaces:
Collection<E>, Iterable<E>, List<E>, PCollection<E>
All Known Subinterfaces:
PStack<E>, PVector<E>
All Known Implementing Classes:
ConsPStack, TreePVector

public interface PSequence<E> extends PCollection<E>, List<E>
An immutable, persistent indexed collection.
  • Method Details

    • plus

      PSequence<E> plus(E e)
      Specified by:
      plus in interface PCollection<E>
      Parameters:
      e -
      Returns:
      a collection which contains e and all of the elements of this
    • plusAll

      PSequence<E> plusAll(Collection<? extends E> list)
      Specified by:
      plusAll in interface PCollection<E>
      Parameters:
      list -
      Returns:
      a collection which contains all of the elements of list and this
    • with

      PSequence<E> with(int i, E e)
      Parameters:
      i -
      e -
      Returns:
      a sequence consisting of the elements of this with e replacing the element at index i.
    • plus

      PSequence<E> plus(int i, E e)
      Parameters:
      i -
      e -
      Returns:
      a sequence consisting of the elements of this with e inserted at index i.
    • plusAll

      PSequence<E> plusAll(int i, Collection<? extends E> list)
      Parameters:
      i -
      list -
      Returns:
      a sequence consisting of the elements of this with list inserted at index i.
    • minus

      PSequence<E> minus(Object e)
      Returns a sequence consisting of the elements of this without the first occurrence of e.
      Specified by:
      minus in interface PCollection<E>
      Parameters:
      e -
      Returns:
      this with a single instance of e removed, if e is in this
    • minusAll

      PSequence<E> minusAll(Collection<?> list)
      Specified by:
      minusAll in interface PCollection<E>
      Parameters:
      list -
      Returns:
      this with all elements of list completely removed
    • minus

      PSequence<E> minus(int i)
      Parameters:
      i -
      Returns:
      a sequence consisting of the elements of this with the element at index i removed.
    • subList

      PSequence<E> subList(int start, int end)
      Specified by:
      subList in interface List<E>
    • addAll

      @Deprecated boolean addAll(int index, Collection<? extends E> c)
      Deprecated.
      Specified by:
      addAll in interface List<E>
    • set

      @Deprecated E set(int index, E element)
      Deprecated.
      Specified by:
      set in interface List<E>
    • add

      @Deprecated void add(int index, E element)
      Deprecated.
      Specified by:
      add in interface List<E>
    • remove

      @Deprecated E remove(int index)
      Deprecated.
      Specified by:
      remove in interface List<E>