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
Modifier and TypeMethodDescriptionbooleanvoidPerforms the given action for each entry in this set until all elements have been processed or the action throws an exception.booleanisEmpty()toString()The string representation consists of a list of elements in the ascending order of hash codes.
-
Method Details
-
add
- Returns:
- new set with added element, or this if element already in the set
-
remove
- Returns:
- new set with removed element, or this if set does not contain given element
-
contains
- Returns:
- true if this set contains the specified element
-
forEach
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
-
toString
String toString()The string representation consists of a list of elements in the ascending order of hash codes. If two elements have same hash code, then their relative order is arbitrary, but stable.
-