Add @Override to toString

This commit is contained in:
2022-04-07 18:08:05 +02:00
parent dfbdd6dc9d
commit 4c613f5165
3 changed files with 3 additions and 0 deletions

View File

@ -110,6 +110,7 @@ public class Body {
* mass, position (mass center) and current movement. Example: * mass, position (mass center) and current movement. Example:
* "5.972E24 kg, position: [1.48E11,0.0,0.0] m, movement: [0.0,29290.0,0.0] m/s." * "5.972E24 kg, position: [1.48E11,0.0,0.0] m, movement: [0.0,29290.0,0.0] m/s."
*/ */
@Override
public String toString() { public String toString() {
return String.format( return String.format(
"%g kg, position: %s m, movement: %s m/s.", "%g kg, position: %s m, movement: %s m/s.",

View File

@ -101,6 +101,7 @@ public class BodyForceTreeMap {
* Returns a readable representation of this map, in which key-value pairs are ordered * Returns a readable representation of this map, in which key-value pairs are ordered
* descending according to the mass of the bodies. * descending according to the mass of the bodies.
*/ */
@Override
public String toString() { public String toString() {
return toString(root); return toString(root);
} }

View File

@ -97,6 +97,7 @@ public class Vector3 {
* Returns the coordinates of this vector in brackets as a string * Returns the coordinates of this vector in brackets as a string
* in the form "[x,y,z]", e.g., "[1.48E11,0.0,0.0]". * in the form "[x,y,z]", e.g., "[1.48E11,0.0,0.0]".
*/ */
@Override
public String toString() { public String toString() {
return String.format("[%g,%g,%g]", x, y, z); return String.format("[%g,%g,%g]", x, y, z);
} }