Interface PVector<E>

  • Type Parameters:
    E -
    All Superinterfaces:
    java.util.Collection<E>, java.lang.Iterable<E>, java.util.List<E>, PCollection<E>, PSequence<E>
    All Known Implementing Classes:
    TreePVector

    public interface PVector<E>
    extends PSequence<E>
    An immutable, persistent list.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      PVector<E> minus​(int i)  
      PVector<E> minus​(java.lang.Object e)
      Returns a sequence consisting of the elements of this without the first occurrence of e.
      PVector<E> minusAll​(java.util.Collection<?> list)  
      PVector<E> plus​(int i, E e)  
      PVector<E> plus​(E e)
      Returns a vector consisting of the elements of this with e appended.
      PVector<E> plusAll​(int i, java.util.Collection<? extends E> list)  
      PVector<E> plusAll​(java.util.Collection<? extends E> list)
      Returns a vector consisting of the elements of this with list appended.
      PVector<E> subList​(int start, int end)  
      PVector<E> with​(int i, E e)  
      • 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, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArray
    • Method Detail

      • plus

        PVector<E> plus​(E e)
        Returns a vector consisting of the elements of this with e appended.
        Specified by:
        plus in interface PCollection<E>
        Specified by:
        plus in interface PSequence<E>
        Returns:
        a collection which contains e and all of the elements of this
      • plusAll

        PVector<E> plusAll​(java.util.Collection<? extends E> list)
        Returns a vector consisting of the elements of this with list appended.
        Specified by:
        plusAll in interface PCollection<E>
        Specified by:
        plusAll in interface PSequence<E>
        Returns:
        a collection which contains all of the elements of list and this
      • with

        PVector<E> with​(int i,
                        E e)
        Specified by:
        with in interface PSequence<E>
        Returns:
        a sequence consisting of the elements of this with e replacing the element at index i.
      • plus

        PVector<E> plus​(int i,
                        E e)
        Specified by:
        plus in interface PSequence<E>
        Returns:
        a sequence consisting of the elements of this with e inserted at index i.
      • plusAll

        PVector<E> plusAll​(int i,
                           java.util.Collection<? extends E> list)
        Specified by:
        plusAll in interface PSequence<E>
        Returns:
        a sequence consisting of the elements of this with list inserted at index i.
      • minus

        PVector<E> minus​(java.lang.Object e)
        Description copied from interface: PSequence
        Returns a sequence consisting of the elements of this without the first occurrence of e.
        Specified by:
        minus in interface PCollection<E>
        Specified by:
        minus in interface PSequence<E>
        Returns:
        this with a single instance of e removed, if e is in this
      • minus

        PVector<E> minus​(int i)
        Specified by:
        minus in interface PSequence<E>
        Returns:
        a sequence consisting of the elements of this with the element at index i removed.
      • subList

        PVector<E> subList​(int start,
                           int end)
        Specified by:
        subList in interface java.util.List<E>
        Specified by:
        subList in interface PSequence<E>