changes to reflect ssjava design changes and temporarily remove some of ssjava class...
[IRC.git] / Robust / src / ClassLibrary / HashSet.java
1 public class HashSet {
2   HashMap map;
3   HashSet() {
4     map=new HashMap();
5   }
6   HashSet(int initialCapacity) {
7     map=new HashMap(initialCapacity);
8   }
9   HashSet(int initialCapacity, float loadFactor) {
10     map=new HashMap(initialCapacity, loadFactor);
11   }
12   public boolean add(Object o) {
13     return (map.put(o, this)==null);
14   }
15   public boolean remove(Object o) {
16     return (map.remove(o)!=null);
17   }
18   public boolean isEmpty() {
19     return map.isEmpty();
20   }
21   public void clear() {
22     map.clear();
23   }
24   public boolean contains(Object o) {
25     return map.containsKey(o);
26   }
27   public int size() {
28     return map.size();
29   }
30   public HashMapIterator iterator() {
31     return (HashMapIterator)map.iterator(0);
32   }
33 }