Class JointSet<E>

java.lang.Object
edu.udel.cis.vsl.sarl.util.JointCollection<E>
edu.udel.cis.vsl.sarl.util.JointSet<E>
Type Parameters:
E - the type of the elements of the sets
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public class JointSet<E> extends JointCollection<E> implements Set<E>

A set representing the union of two *disjoint* sets. This set is immutable: the modification methods will all throw UnsupportedOperationException s.

This set is backed by the two underlying sets. I.e., changes to the underlying sets will be reflected in this set.

  • Constructor Details

    • JointSet

      public JointSet(Set<E> set1, Set<E> set2)
      Constructs a new set representing the union of the two disjoint sets set1 and set2. If set1 and set2 are not disjoint (i.e., if there is some x such that set1.contains(x) && set2.contains(x)) the behavior is completely undefined and probably wrong.
      Parameters:
      set1 - the first set
      set2 - the second set