6 HashSet(int initialCapacity) {
7 map=new HashMap(initialCapacity);
9 HashSet(int initialCapacity, float loadFactor) {
10 map=new HashMap(initialCapacity, loadFactor);
12 public boolean add(Object o) {
13 return (map.put(o, this)==null);
15 public boolean remove(Object o) {
16 return (map.remove(o)!=null);
18 public boolean isEmpty() {
21 public boolean contains(Object o) {
22 return map.containsKey(o);
27 public HashMapIterator iterator() {
28 return map.iterator(0);