AB3: Fix toString()
This commit is contained in:
@ -86,13 +86,14 @@ public class BodyForceTreeMap {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
private String toString(BodyForceTreeMapItem item, String indent) {
|
||||
private String toString(BodyForceTreeMapItem item) {
|
||||
String s = "";
|
||||
if (item == null) {
|
||||
return "";
|
||||
return s;
|
||||
}
|
||||
String s = String.format("%s{%s: %s}\n", indent, item.key(), item.value());
|
||||
s += this.toString(item.left(), indent + "| ");
|
||||
s += this.toString(item.right(), indent + "| ");
|
||||
s += this.toString(item.right());
|
||||
s += String.format("{%s: %s}\n", item.key(), item.value());
|
||||
s += this.toString(item.left());
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -101,6 +102,6 @@ public class BodyForceTreeMap {
|
||||
* descending according to the mass of the bodies.
|
||||
*/
|
||||
public String toString() {
|
||||
return toString(root, "");
|
||||
return toString(root);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user