Aufgabenblatt 3

This commit is contained in:
Anton Ertl
2022-03-28 15:32:44 +02:00
parent 06d7e6dfaf
commit 324626f5eb
5 changed files with 314 additions and 0 deletions

40
src/BodyForceTreeMap.java Normal file
View File

@ -0,0 +1,40 @@
// A map that associates a Body with a Vector3 (typically this is the force exerted on the body).
// The number of key-value pairs is not limited.
public class BodyForceTreeMap {
//TODO: declare variables.
// Adds a new key-value association to this map. If the key already exists in this map,
// the value is replaced and the old value is returned. Otherwise 'null' is returned.
// Precondition: key != null.
public Vector3 put(Body key, Vector3 value) {
//TODO: implement method.
return null;
}
// Returns the value associated with the specified key, i.e. the method returns the force vector
// associated with the specified key. Returns 'null' if the key is not contained in this map.
// Precondition: key != null.
public Vector3 get(Body key) {
//TODO: implement method.
return null;
}
// Returns 'true' if this map contains a mapping for the specified key.
public boolean containsKey(Body key) {
//TODO: implement method.
return false;
}
// Returns a readable representation of this map, in which key-value pairs are ordered
// descending according to the mass of the bodies.
public String toString() {
//TODO: implement method.
return null;
}
}