Class PSet<E>
- java.lang.Object
-
- org.apache.jena.atlas.lib.persistent.PSet<E>
-
- Type Parameters:
E- the type of element in this set
- All Implemented Interfaces:
PersistentSet<E>
public class PSet<E> extends java.lang.Object implements PersistentSet<E>
A implementation ofPersistentSetusingSet.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<E>asSet()An immutable view of this as ajava.util.Set.booleancontains(E e)static <E> PSet<E>empty()PersistentSet<E>minus(E e)PersistentSet<E>plus(E e)java.util.stream.Stream<E>stream()
-
-
-
Method Detail
-
empty
public static <E> PSet<E> empty()
- Returns:
- an empty set
-
plus
public PersistentSet<E> plus(E e)
- Specified by:
plusin interfacePersistentSet<E>- Parameters:
e- an element- Returns:
- a new set with the elements of this set and
e
-
minus
public PersistentSet<E> minus(E e)
- Specified by:
minusin interfacePersistentSet<E>- Parameters:
e- an element- Returns:
- a new set with the elements of this set except
e
-
contains
public boolean contains(E e)
- Specified by:
containsin interfacePersistentSet<E>- Parameters:
e- an element- Returns:
- whether this set contains
e
-
stream
public java.util.stream.Stream<E> stream()
- Specified by:
streamin interfacePersistentSet<E>- Returns:
- a
Streamof the elements in this set
-
asSet
public java.util.Set<E> asSet()
Description copied from interface:PersistentSetAn immutable view of this as ajava.util.Set.- Specified by:
asSetin interfacePersistentSet<E>
-
-