示例#1
0
  public ExtHashSet union(Collection c) {

    ExtHashSet result = new ExtHashSet();
    result.addAll(this);
    result.addAll(c);

    return result;
  }
示例#2
0
  public ExtHashSet intersection(Collection c) {

    ExtHashSet result = new ExtHashSet();
    Object o;

    Iterator i = c.iterator();
    while (i.hasNext()) {
      o = i.next();
      if (this.contains(o)) {
        result.add(o);
      }
    }

    return result;
  }