Interface PersistentSet<E>

Type Parameters:
E - the type of element in this set
All Known Implementing Classes:
PSet

public interface PersistentSet<E>
A persistent set data structure.
  • Method Details

    • empty

      static <T> PersistentSet<T> empty()
      Returns:
      an empty set
    • plus

      PersistentSet<E> plus(E e)
      Parameters:
      e - an element
      Returns:
      a new set with the elements of this set and e
    • minus

      PersistentSet<E> minus(E e)
      Parameters:
      e - an element
      Returns:
      a new set with the elements of this set except e
    • contains

      boolean contains(E e)
      Parameters:
      e - an element
      Returns:
      whether this set contains e
    • stream

      Stream<E> stream()
      Returns:
      a Stream of the elements in this set
    • asSet

      Set<E> asSet()
      An immutable view of this as a java.util.Set.