Refactored for AB5

This commit is contained in:
2022-05-06 22:42:28 +02:00
parent e84bf3bf4a
commit 6b1f1ecc2a
6 changed files with 176 additions and 199 deletions

View File

@ -1,42 +1,46 @@
public class NamedBody /* TODO: add clause(s) */
{
public class NamedBody /* TODO: add clause(s) */ {
// TODO: add missing parts of this class.
// Initializes this with name, mass, current position and movement. The associated force
// is initialized with a zero vector.
/**
* Initializes this with name, mass, current position and movement. The associated force
* is initialized with a zero vector.
*/
public NamedBody(String name, double mass, Vector3 massCenter, Vector3 currentMovement) {
// TODO: implement constructor.
}
// Returns the name of the body.
/**
* Returns the name of the body.
*/
public String getName() {
// TODO: implement method.
return "";
}
// Compares `this` with the specified object. Returns `true` if the specified `o` is not
// `null` and is of type `NamedBody` and both `this` and `o` have equal names.
// Otherwise `false` is returned.
/**
* Compares `this` with the specified object. Returns `true` if the specified `o` is not
* `null` and is of type `NamedBody` and both `this` and `o` have equal names.
* Otherwise `false` is returned.
*/
public boolean equals(Object o) {
//TODO: implement method.
return false;
}
// Returns the hashCode of `this`.
/**
* Returns the hashCode of `this`.
*/
public int hashCode() {
//TODO: implement method.
return 0;
}
// Returns a readable representation including the name of this body.
/**
* Returns a readable representation including the name of this body.
*/
public String toString() {
//TODO: implement method.
return "";
}
}