mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
Added a proper implementation of TreeSet, based on a Persistent set implementation.
This commit is contained in:
24
classpath/java/util/Cell.java
Normal file
24
classpath/java/util/Cell.java
Normal file
@ -0,0 +1,24 @@
|
||||
package java.util;
|
||||
|
||||
public class Cell <T> {
|
||||
public T value;
|
||||
public Cell<T> next;
|
||||
|
||||
public Cell(T value, Cell<T> next) {
|
||||
this.value = value;
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("(");
|
||||
for (Cell c = this; c != null; c = c.next) {
|
||||
sb.append(value);
|
||||
if (c.next != null) {
|
||||
sb.append(" ");
|
||||
}
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user