Added hashcode & equals based on digest. Added simple toString.
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Fri, 3 Feb 2012 01:37:25 +0000 (01:37 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Fri, 3 Feb 2012 01:37:25 +0000 (01:37 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@385 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/motor/ThrustCurveMotorPlaceholder.java

index 3245eb158d11e2e973ab76a69cb0b72560169f50..1c6e22549e60de232a1ca14ed006cb7ca69a57d3 100644 (file)
@@ -107,6 +107,36 @@ public class ThrustCurveMotorPlaceholder implements Motor {
        public double getTotalImpulseEstimate() {
                return Double.NaN;
        }
-       
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((digest == null) ? 0 : digest.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               ThrustCurveMotorPlaceholder other = (ThrustCurveMotorPlaceholder) obj;
+               if (digest == null) {
+                       if (other.digest != null)
+                               return false;
+               } else if (!digest.equals(other.digest))
+                       return false;
+               return true;
+       }
+
+       @Override
+       public String toString() {
+               return "ThrustCurveMotorPlaceholder [manufacturer=" + manufacturer
+                               + ", designation=" + designation + "]";
+       }
        
 }