GC stress fixes and other bugfixes; classpath progress

This commit is contained in:
Joel Dice
2007-07-29 17:32:23 -06:00
parent d5a00c4556
commit a2bd7d0668
27 changed files with 463 additions and 75 deletions

View File

@ -5,6 +5,11 @@ public class HashSet<T> implements Set<T> {
private final HashMap<T, Object> map;
public HashSet(Collection<T> c) {
map = new HashMap(c.size());
addAll(c);
}
public HashSet(int capacity) {
map = new HashMap(capacity);
}
@ -21,6 +26,10 @@ public class HashSet<T> implements Set<T> {
return map.containsKey(element);
}
public void addAll(Collection<T> c) {
for (T t: c) add(t);
}
public boolean add(T element) {
return map.put(element, Value) != Value;
}