Package org.organicdesign.fp.collections
Interface ImSet<E>
-
- All Superinterfaces:
BaseSet<E>
,Collection<E>
,Iterable<E>
,Set<E>
,Sized
,Transformable<E>
,UnmodCollection<E>
,UnmodIterable<E>
,UnmodSet<E>
- All Known Implementing Classes:
PersistentHashSet
public interface ImSet<E> extends BaseSet<E>
An immutable set with no guarantees about its ordering
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.organicdesign.fp.collections.UnmodIterable
UnmodIterable.UnIterable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MutSet<E>
mutable()
Returns a mutable version of this immutable set.@NotNull ImSet<E>
put(E e)
Adds an element, returning a modified version of the set (leaving the original set unchanged).default @NotNull ImSet<E>
union(@Nullable Iterable<? extends E> iter)
Returns a new set containing all the items.@NotNull ImSet<E>
without(E key)
Removes this key from the set-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.Set
equals, hashCode, size, spliterator
-
Methods inherited from interface org.organicdesign.fp.xform.Transformable
any, toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutList, toMutMap, toMutRrbt, toMutSet, toMutSortedMap, toMutSortedSet
-
-
-
-
Method Detail
-
put
@NotNull @NotNull ImSet<E> put(E e)
Adds an element, returning a modified version of the set (leaving the original set unchanged). If the element already exists in this set, the new value overwrites the old one. If the new element is the same as an old element (based on the address of that item in memory, not an equals test), the old set is returned unchanged.
-
union
@NotNull default @NotNull ImSet<E> union(@Nullable @Nullable Iterable<? extends E> iter)
Description copied from interface:BaseSet
Returns a new set containing all the items.
-
-