Module org.jhotdraw8.icollection
Interface ImmutableAddOnlySet<E>
- Type Parameters:
E- the element type
- All Known Implementing Classes:
ChampAddOnlySet
public interface ImmutableAddOnlySet<E>
An interface to an immutable set that only provides an
add method; the implementation guarantees that the state of the collection does not change.-
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this set that contains all elements of this set and also the specified element.
-
Method Details
-
add
Returns a copy of this set that contains all elements of this set and also the specified element.- Parameters:
element- an element- Returns:
- this set if it already contains the element, or a different set with the element added
-