Package org.sonar.java.collections
Interface PSet<E>
-
- Type Parameters:
E- the type of elements maintained by this set
public interface PSet<E>Persistent (functional) Set.- Author:
- Evgeny Mandrikov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PSet<E>add(E e)booleancontains(E e)voidforEach(Consumer<E> action)Performs the given action for each entry in this set until all elements have been processed or the action throws an exception.booleanisEmpty()PSet<E>remove(E e)StringtoString()The string representation consists of a list of elements in the ascending order of hash codes.
-
-
-
Method Detail
-
remove
PSet<E> remove(E e)
- Returns:
- new set with removed element, or this if set does not contain given element
-
contains
boolean contains(E e)
- Returns:
- true if this set contains the specified element
-
forEach
void forEach(Consumer<E> action)
Performs the given action for each entry in this set until all elements have been processed or the action throws an exception.
-
isEmpty
boolean isEmpty()
- Returns:
- true if this set contains no elements
-
-