Aufgabenblatt 2 preconditions.
This commit is contained in:
@ -6,6 +6,7 @@ public class BodyForceMap {
|
|||||||
//TODO: declare variables.
|
//TODO: declare variables.
|
||||||
|
|
||||||
// Initializes this map with an initial capacity.
|
// Initializes this map with an initial capacity.
|
||||||
|
// Precondition: initialCapacity > 0.
|
||||||
public BodyForceMap(int initialCapacity) {
|
public BodyForceMap(int initialCapacity) {
|
||||||
|
|
||||||
//TODO: define constructor.
|
//TODO: define constructor.
|
||||||
@ -13,6 +14,7 @@ public class BodyForceMap {
|
|||||||
|
|
||||||
// Adds a new key-value association to this map. If the key already exists in this map,
|
// 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.
|
// the value is replaced and the old value is returned. Otherwise 'null' is returned.
|
||||||
|
// Precondition: key != null.
|
||||||
public Vector3 put(Body key, Vector3 force) {
|
public Vector3 put(Body key, Vector3 force) {
|
||||||
|
|
||||||
//TODO: implement method.
|
//TODO: implement method.
|
||||||
@ -20,7 +22,8 @@ public class BodyForceMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns the value associated with the specified key, i.e. the returns the force vector
|
// Returns the value associated with the specified key, i.e. the returns the force vector
|
||||||
// associated with the specified body.
|
// associated with the specified body. Returns 'null' if the key is not contained in this map.
|
||||||
|
// Precondition: key != null.
|
||||||
public Vector3 get(Body key) {
|
public Vector3 get(Body key) {
|
||||||
|
|
||||||
//TODO: implement method.
|
//TODO: implement method.
|
||||||
|
@ -8,6 +8,7 @@ public class BodyQueue {
|
|||||||
//TODO: declare variables.
|
//TODO: declare variables.
|
||||||
|
|
||||||
// Initializes this queue with an initial capacity.
|
// Initializes this queue with an initial capacity.
|
||||||
|
// Precondition: initialCapacity > 0.
|
||||||
public BodyQueue(int initialCapacity) {
|
public BodyQueue(int initialCapacity) {
|
||||||
|
|
||||||
//TODO: define constructor.
|
//TODO: define constructor.
|
||||||
@ -16,6 +17,7 @@ public class BodyQueue {
|
|||||||
// Initializes this queue as an independent copy of the specified queue.
|
// Initializes this queue as an independent copy of the specified queue.
|
||||||
// Calling methods of this queue will not affect the specified queue
|
// Calling methods of this queue will not affect the specified queue
|
||||||
// and vice versa.
|
// and vice versa.
|
||||||
|
// Precondition: q != null.
|
||||||
public BodyQueue(BodyQueue q) {
|
public BodyQueue(BodyQueue q) {
|
||||||
|
|
||||||
//TODO: define constructor.
|
//TODO: define constructor.
|
||||||
|
Reference in New Issue
Block a user