mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
Merge branch 'master' of dice:git/vm
This commit is contained in:
commit
4b9bcd97c1
@ -1,6 +1,6 @@
|
|||||||
package java.util;
|
package java.util;
|
||||||
|
|
||||||
public class TreeSet<T> implements Iterable<T> {
|
public class TreeSet<T> implements Collection<T> {
|
||||||
private PersistentSet<Cell<T>> set;
|
private PersistentSet<Cell<T>> set;
|
||||||
private int size;
|
private int size;
|
||||||
|
|
||||||
@ -59,6 +59,15 @@ public class TreeSet<T> implements Iterable<T> {
|
|||||||
return size;
|
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<T> implements java.util.Iterator<T> {
|
private class MyIterator<T> implements java.util.Iterator<T> {
|
||||||
private PersistentSet.Path<Cell<T>> path;
|
private PersistentSet.Path<Cell<T>> path;
|
||||||
private PersistentSet.Path<Cell<T>> nextPath;
|
private PersistentSet.Path<Cell<T>> nextPath;
|
||||||
|
Loading…
Reference in New Issue
Block a user