diff --git a/classpath/java/util/TreeSet.java b/classpath/java/util/TreeSet.java index a35fe754ff..47343c65d3 100644 --- a/classpath/java/util/TreeSet.java +++ b/classpath/java/util/TreeSet.java @@ -1,6 +1,6 @@ package java.util; -public class TreeSet implements Iterable { +public class TreeSet implements Collection { private PersistentSet> set; private int size; @@ -59,6 +59,15 @@ public class TreeSet implements Iterable { return size; } + public boolean contains(T value) { + return !set.find(new Cell(value, null)).fresh(); + } + + public void clear() { + set = new PersistentSet(set.comparator()); + size = 0; + } + private class MyIterator implements java.util.Iterator { private PersistentSet.Path> path; private PersistentSet.Path> nextPath;