create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / gui / dialogs / motor / thrustcurve / MotorHolder.java
1 package net.sf.openrocket.gui.dialogs.motor.thrustcurve;
2
3 import net.sf.openrocket.motor.ThrustCurveMotor;
4
5 class MotorHolder {
6         
7         private final ThrustCurveMotor motor;
8         private final int index;
9         
10         public MotorHolder(ThrustCurveMotor motor, int index) {
11                 this.motor = motor;
12                 this.index = index;
13         }
14         
15         public ThrustCurveMotor getMotor() {
16                 return motor;
17         }
18         
19         public int getIndex() {
20                 return index;
21         }
22         
23         @Override
24         public String toString() {
25                 return motor.getDesignation();
26         }
27         
28         @Override
29         public boolean equals(Object obj) {
30                 if (!(obj instanceof MotorHolder))
31                         return false;
32                 MotorHolder other = (MotorHolder) obj;
33                 return this.motor.equals(other.motor);
34         }
35         
36         @Override
37         public int hashCode() {
38                 return motor.hashCode();
39         }
40 }