Class 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