mirror of
https://github.com/corda/corda.git
synced 2025-03-17 17:45:17 +00:00
implement TreeSet.toString()
This commit is contained in:
parent
3779f21424
commit
f84b865f03
@ -3,10 +3,10 @@ package java.util;
|
||||
public class Collections {
|
||||
private Collections() { }
|
||||
|
||||
static String toString(List l) {
|
||||
static String toString(Collection c) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[");
|
||||
for (Iterator it = l.iterator(); it.hasNext();) {
|
||||
for (Iterator it = c.iterator(); it.hasNext();) {
|
||||
sb.append(it.next());
|
||||
if (it.hasNext()) {
|
||||
sb.append(",");
|
||||
|
@ -17,6 +17,10 @@ public class TreeSet<T> implements Collection<T> {
|
||||
return new MyIterator<T>(set.first());
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return Collections.toString(this);
|
||||
}
|
||||
|
||||
public boolean add(T value) {
|
||||
PersistentSet.Path<Cell<T>> p = set.find(new Cell(value, null));
|
||||
if (p.fresh()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user