Package org.organicdesign.fp.collections
Interface BaseSet<E>
-
- All Superinterfaces:
java.util.Collection<E>,java.lang.Iterable<E>,java.util.Set<E>,Sized,Transformable<E>,UnmodCollection<E>,UnmodIterable<E>,UnmodSet<E>
- All Known Subinterfaces:
ImSet<E>,ImSortedSet<E>,MutableSet<E>
- All Known Implementing Classes:
PersistentHashSet,PersistentHashSet.MutableHashSet,PersistentTreeSet
public interface BaseSet<E> extends UnmodSet<E>
Adds copy-on-write, "fluent interface" methods toUnmodSet. Lowest common ancestor ofMutableSet,ImSet, andImSortedSet.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BaseSet<E>put(E e)Adds an element.BaseSet<E>union(java.lang.Iterable<? extends E> iter)Returns a new set containing all the items.BaseSet<E>without(E key)Removes this key from the set-
Methods inherited from interface org.organicdesign.fp.xform.Transformable
toImList, toImMap, toImRrbt, toImSet, toImSortedMap, toImSortedSet, toMutableList, toMutableMap, toMutableRrbt, toMutableSet, toMutableSortedMap, toMutableSortedSet
-
-
-
-
Method Detail
-
put
BaseSet<E> put(E e)
Adds an element. 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 may be returned unchanged.- Parameters:
e- the element to add to this set- Returns:
- a new set with the element added (see note above about adding duplicate elements).
-
union
BaseSet<E> union(java.lang.Iterable<? extends E> iter)
Returns a new set containing all the items.
-
-