mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
implement a few more classpath methods, including Collection.addAll and Collection.toArray
This commit is contained in:
@ -41,6 +41,12 @@ public class TreeSet<T> implements Collection<T> {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean addAll(Collection<? extends T> collection) {
|
||||
boolean change = false;
|
||||
for (T t: collection) if (add(t)) change = true;
|
||||
return change;
|
||||
}
|
||||
|
||||
// Used by hashMaps for replacement
|
||||
public void addAndReplace(T value) {
|
||||
PersistentSet.Path<Cell<T>> p = set.find(new Cell(value, null));
|
||||
@ -69,6 +75,10 @@ public class TreeSet<T> implements Collection<T> {
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T[] toArray(T[] array) {
|
||||
return Collections.toArray(this, array);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
Reference in New Issue
Block a user