Class ViewOnSetUnion<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- fr.univ_artois.lgi2a.similar.microkernel.dynamicstate.ViewOnSetUnion<E>
-
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
public class ViewOnSetUnion<E> extends AbstractSet<E>
This class models a set as the union of two other sets. The union is dynamic: an element added to one set of the union is automatically added to the union. The same goes for removal.Warning
This implementation assumes that the two sets are disjoint.
- Author:
- Yoann Kubera
-
-
Constructor Summary
Constructors Constructor Description ViewOnSetUnion(Set<? extends E> set1, Set<? extends E> set2)
Builds a view on the dynamic union of two sets.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<E>
iterator()
int
size()
-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-