diff --git a/src/BodyForceMap.java b/src/BodyForceMap.java index 35711b9..ab12eeb 100644 --- a/src/BodyForceMap.java +++ b/src/BodyForceMap.java @@ -6,6 +6,7 @@ public class BodyForceMap { //TODO: declare variables. // Initializes this map with an initial capacity. + // Precondition: initialCapacity > 0. public BodyForceMap(int initialCapacity) { //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, // the value is replaced and the old value is returned. Otherwise 'null' is returned. + // Precondition: key != null. public Vector3 put(Body key, Vector3 force) { //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 - // 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) { //TODO: implement method. diff --git a/src/BodyQueue.java b/src/BodyQueue.java index ef38f4d..f40d41e 100644 --- a/src/BodyQueue.java +++ b/src/BodyQueue.java @@ -8,6 +8,7 @@ public class BodyQueue { //TODO: declare variables. // Initializes this queue with an initial capacity. + // Precondition: initialCapacity > 0. public BodyQueue(int initialCapacity) { //TODO: define constructor. @@ -16,6 +17,7 @@ public class BodyQueue { // Initializes this queue as an independent copy of the specified queue. // Calling methods of this queue will not affect the specified queue // and vice versa. + // Precondition: q != null. public BodyQueue(BodyQueue q) { //TODO: define constructor.