Added no arg constructor to support Comparable types.

This commit is contained in:
Matt Weaver 2008-07-14 08:45:51 -06:00
parent bba4f75c2f
commit 2d1ec11edc

View File

@ -23,6 +23,15 @@ public class TreeSet<T> extends AbstractSet<T> implements Collection<T> {
size = 0;
}
public TreeSet() {
set = new PersistentSet(new Comparator<Cell<T>>() {
public int compare(Cell<T> a, Cell<T> b) {
return ((Comparable)a).compareTo(b);
}
});
size = 0;
}
public Iterator<T> iterator() {
return new MyIterator<T>(set.first());
}