Reimplement motor handling so the android application relies more heavily on the...
[debian/openrocket] / android / src / net / sf / openrocket / android / thrustcurve / DownloadResponse.java
1 package net.sf.openrocket.android.thrustcurve;\r
2 \r
3 import java.util.HashMap;\r
4 import java.util.Map;\r
5 \r
6 \r
7 public class DownloadResponse {\r
8 \r
9         private Map<Integer,MotorBurnFile> data = new HashMap<Integer,MotorBurnFile>();\r
10         \r
11         private String error = null;\r
12         \r
13         public void add( MotorBurnFile mbd ) {\r
14                 MotorBurnFile currentData = data.get(mbd.getMotorId());\r
15                 if ( currentData == null || currentData.getThrustCurveMotor() == null ) {\r
16                         data.put(mbd.getMotorId(),mbd);\r
17                 }\r
18         }\r
19 \r
20         public MotorBurnFile getData(Integer motor_id) {\r
21                 return data.get(motor_id);\r
22         }\r
23         \r
24         public void setError(String error) {\r
25                 this.error = error;\r
26         }\r
27         \r
28         public String getError() {\r
29                 return error;\r
30         }\r
31         \r
32         @Override\r
33         public String toString() {\r
34                 return "DownloadResponse [error=" + error + ", data=" + data + "]";\r
35         }\r
36 \r
37 }\r