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() {
24 public boolean contains(Object o) {
25 return map.containsKey(o);
30 public HashMapIterator iterator() {
31 return (HashMapIterator)map.iterator(0);