Class Set<E>

java.lang.Object
com.github.basking2.sdsai.RedBlackTree<E>
com.github.basking2.sdsai.Set<E>
All Implemented Interfaces:
Iterable<Key<E>>

public class Set<E> extends RedBlackTree<E>
Sets are different than Collections. A group may have two instance of a data type. A set has either one instance or no instances.
  • Constructor Details

    • Set

      public Set()
  • Method Details

    • add

      public void add(Key<E> k)
      This calles add(o,NODUPKEYS). This add is provided for compatibility. WARNING: This does NOT notify the user if the key is not added because the object already exists in the tree.
      Overrides:
      add in class RedBlackTree<E>
    • union

      public Set<E> union(Set<E> s)
      Make a new set consisting of two other sets.
    • intersect

      public Set<E> intersect(Set<E> s)
      Make a new set consisting of the intersection of two other sets.
    • disjunction

      public Set<E> disjunction(Set<E> s)
      This is not a standard set operation, per se. This the set of all elements that are in one set or the other but not both.