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)
boolean
contains(E e)
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.boolean
isEmpty()
PSet<E>
remove(E e)
String
toString()
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
-
-