Repository navigation
Expand file tree
/
Copy pathSailplane.java
More file actions
370 lines (339 loc) · 12.6 KB
/
Copy pathSailplane.java
File metadata and controls
370 lines (339 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package DataObjects;
/**
* This Class stores the data about a Sailplane
*
* @author garreola-gutierrez
*/
public class Sailplane {
String Number;
String type;
String owner;
String contactInformation;
int maximumGrossWeight;
int emptyWeight;
int indicatedStallSpeed;
int maximumWinchingSpeed;
int maximumAllowableWeakLinkStrength;
int maximumTension;
boolean carryBallast;
boolean hasBallast;
public String toString(){
return Number;
}
/**
* Default Constructor
*/
public Sailplane(){
}
/**
* Constructor with all part of Sailplane object
* @param number n-number of sailplane
* @param type1 type of sailplane
* @param owners owner of sailplane
* @param contactInfo contact information of sailplane
* @param maximumGrossWeight1 maximum gross weight of sailplane
* @param emptyWeight1 empty weight of sailplane
* @param indicatedStallSpeed1 indicated stall speed of sailplane
* @param maximumWinchingSpeed1 maximum winching speed of sailplane
* @param maximumAllowableWeakLinkStrength1 maximum allowable weak link strength of sailplane
* @param maximumTension1 maximum tension of sailplane
* @param carryBallast can sailplane carry ballast
* @param hasBallast is sailplane carrying ballast
*/
public Sailplane(String number, String type1, String owners, String contactInfo,
int maximumGrossWeight1, int emptyWeight1, int indicatedStallSpeed1,
int maximumWinchingSpeed1, int maximumAllowableWeakLinkStrength1,
int maximumTension1, boolean carryBallast1){
Number = number;
type = type1;
owner = owners;
contactInformation = contactInfo;
maximumGrossWeight = maximumGrossWeight1;
emptyWeight= emptyWeight1;
indicatedStallSpeed = indicatedStallSpeed1;
maximumWinchingSpeed = maximumWinchingSpeed1;
maximumAllowableWeakLinkStrength = maximumAllowableWeakLinkStrength1;
carryBallast = carryBallast1;
}
public Sailplane(String number, String type1,
int maximumGrossWeight1, int emptyWeight1, int indicatedStallSpeed1,
int maximumWinchingSpeed1, int maximumAllowableWeakLinkStrength1,
int maximumTension1, boolean carryBallast1){
Number = number;
type = type1;
maximumGrossWeight = maximumGrossWeight1;
emptyWeight= emptyWeight1;
indicatedStallSpeed = indicatedStallSpeed1;
maximumWinchingSpeed = maximumWinchingSpeed1;
maximumAllowableWeakLinkStrength = maximumAllowableWeakLinkStrength1;
carryBallast = carryBallast1;
}
public Sailplane(String number, String type1,
int maximumGrossWeight1, int emptyWeight1, int indicatedStallSpeed1,
int maximumWinchingSpeed1, int maximumAllowableWeakLinkStrength1,
int maximumTension1, boolean carryBallast1, boolean hasBallast1){
Number = number;
type = type1;
maximumGrossWeight = maximumGrossWeight1;
emptyWeight= emptyWeight1;
indicatedStallSpeed = indicatedStallSpeed1;
maximumWinchingSpeed = maximumWinchingSpeed1;
maximumAllowableWeakLinkStrength = maximumAllowableWeakLinkStrength1;
carryBallast = carryBallast1;
hasBallast = hasBallast1;
}
/**
* This method allows user to mark if sailplane can carry ballast
*
*
* @param carryBallast the boolean check if sailplane can carry ballast
* of the Sailplane object
*/
public void setCarryBallast(boolean carryBallast1){
carryBallast = carryBallast1;
}
/**
* Returns an Sailplane object boolean if it can carry ballast.
* @return the boolean if it can carry ballast
*/
public boolean getCarryBallast(){
return carryBallast;
}
/**
* This method allows user to mark if sailplane has ballast
*
* @param hasBallast the boolean check if sailplane has ballast
* of the Sailplane object
*/
public void setHasBallast(boolean hasBallast1){
if(carryBallast ==false)
{
hasBallast = false;
}
else{
hasBallast = hasBallast;
}
}
/**
* Returns an Sailplane object boolean if has ballast ballast.
* @return the boolean if it has ballast
*/
public boolean gethasBallast(){
if(carryBallast ==false)
{
return false;
}
else{
return hasBallast;
}
}
/**
* This method can change the n-number and makes the
* n-number part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param number1 the String that is designated to n-number
* of the Sailplane object
*/
public void setNumber(String number1){
Number = number1;
}
/**
* Returns an Sailplane object n-number to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the n-number of Sailplane object
*/
public String getNumber(){
return Number;
}
/**
* This method can change the type and makes the
* type part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param type1 the String that is designated to type
* of the Sailplane object
*/
public void setType(String type1){
type = type1;
}
/**
* Returns an Sailplane object type to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the type of Sailplane object
*/
public String getType(){
return type;
}
/**
* This method can change the owner and makes the
* owner part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param owners the String that is designated to owner
* of the Sailplane object
*/
public void setOwner(String owners){
owner = owners;
}
/**
* Returns an Sailplane object owner to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the owner of Sailplane object
*/
public String getOwner(){
return owner;
}
/**
* This method can change the contact information and makes the
* contact information part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param contactInfo the String that is designated to contact
* information of the Sailplane object
*/
public void setContactInformation(String contactInfo){
contactInformation = contactInfo;
}
/**
* Returns an Sailplane object contact information to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the contact information of Sailplane object
*/
public String getContactInformation(){
return contactInformation;
}
/**
* This method can change the maximum gross weight and makes the
* maximum gross weight part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param maximumGrossWeight1 the int that is designated to the
* maximum gross weight of the Sailplane object
*/
public void setMaximumGrossWeight(int maximumGrossWeight1){
maximumGrossWeight = maximumGrossWeight1;
}
/**
* Returns an Sailplane object maximum gross weight to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the maximum gross weight of Sailplane object
*/
public int getMaximumGrossWeight (){
return maximumGrossWeight ;
}
/**
* This method can change the empty Weight and makes the
* empty weight part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param emptyWeight1 the int that is designated to empty weight
* of the Sailplane object
*/
public void setEmptyWeight(int emptyWeight1){
emptyWeight = emptyWeight1;
}
/**
* Returns an Sailplane object empty weight to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the empty weight of Sailplane object
*/
public int getEmptyWeight(){
return emptyWeight ;
}
/**
* This method can change the indicated stall speed and makes the
* indicated stall speed part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param indicatedStallSpeed1 the int that is designated to indicated
* stall speed of the Sailplane object
*/
public void setIndicatedStallSpeed(int indicatedStallSpeed1){
indicatedStallSpeed = indicatedStallSpeed1;
}
/**
* Returns an Sailplane object indicated stall speed to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the indicated stall speed of Sailplane object
*/
public int getIndicatedStallSpeed(){
return indicatedStallSpeed ;
}
/**
* This method can change maximum winching speed and makes the
* maximum winching speed part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param maximumWinchingSpeed1 the int that is designated to maximum
* winching speed of the Sailplane object
*/
public void setMaximumWinchingSpeed(int maximumWinchingSpeed1){
maximumWinchingSpeed = maximumWinchingSpeed1;
}
/**
* Returns an Sailplane object maximum winching speed to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the maximum winching speed of Sailplane object
*/
public int getMaximumWinchingSpeed(){
return maximumWinchingSpeed;
}
/**
* This method can change the maximum allowableWeakLinkStrength and makes the
* maximum allowable weak link strength part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param maximumAllowableWeakLinkStrength1 the int that is designated
* to indicated stall speed of
* the Sailplane object
*/
public void setMaximumAllowableWeakLinkStrength(
int maximumAllowableWeakLinkStrength1){
maximumAllowableWeakLinkStrength = maximumAllowableWeakLinkStrength1;
}
/**
* Returns an Sailplane object maximum allowable weak link strength
* to be displayed.This method always returns immediately,only if
* sailplane exists.
*
* @return the maximum allowableWeakLinkStrength of Sailplane object
*/
public int getMaximumAllowableWeakLinkStrength(){
return maximumAllowableWeakLinkStrength;
}
/**
* This method can change the maximum tension and makes the
* maximum tension part of the Sailplane object.
* This method always works, only if sailplane already
* exists.
*
* @param maximumTension1 the int that is designated to maximum Tension
* of the Sailplane object
*/
public void setMaximumTension(int maximumTension1){
maximumTension = maximumTension1;
}
/**
* Returns an Sailplane object maximum tension to be displayed.
* This method always returns immediately,only if sailplane exists.
* @return the maximum tension of Sailplane object
*/
public int getMaximumTension(){
return maximumTension;
}
}