Interface PSet<E>

  • Type Parameters:
    E -
    All Superinterfaces:
    java.util.Collection<E>, java.lang.Iterable<E>, PCollection<E>, java.util.Set<E>
    All Known Subinterfaces:
    PSortedSet<E>
    All Known Implementing Classes:
    MapPSet, OrderedPSet, TreePSet

    public interface PSet<E>
    extends PCollection<E>, java.util.Set<E>
    An immutable, persistent set, containing no duplicate elements.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default PSet<E> intersect​(java.util.Collection<? extends E> list)  
      PSet<E> minus​(java.lang.Object e)  
      PSet<E> minusAll​(java.util.Collection<?> list)  
      PSet<E> plus​(E e)  
      PSet<E> plusAll​(java.util.Collection<? extends E> list)  
      • 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.Set

        add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
    • Method Detail

      • plus

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

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

        PSet<E> minus​(java.lang.Object e)
        Specified by:
        minus in interface PCollection<E>
        Returns:
        this with a single instance of e removed, if e is in this
      • minusAll

        PSet<E> minusAll​(java.util.Collection<?> list)
        Specified by:
        minusAll in interface PCollection<E>
        Returns:
        this with all elements of list completely removed
      • intersect

        default PSet<E> intersect​(java.util.Collection<? extends E> list)
        Returns:
        the equivalent of this.minusAll(this.minusAll(list)).