-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group 3 #21
base: master
Are you sure you want to change the base?
Group 3 #21
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,49 @@ | ||||
import models.MilitaryType; | ||||
import Planes.MilitaryPlane; | ||||
import Planes.Plane; | ||||
|
||||
import java.util.*; | ||||
|
||||
public class Airport { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class has no documentation |
||||
|
||||
/** | ||||
* Prints transport military planes | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add content for documentation |
||||
*/ | ||||
private void printMaxTransportMilitaryPlane() { | ||||
List<MilitaryPlane> transportMilitaryPlanes = new ArrayList<>(); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not used |
||||
Plane maxPlane = null; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this line to before the for loop. |
||||
|
||||
// print banner | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment can be omitted. |
||||
System.out.println ("*********************************************"); | ||||
System.out.println ("***** Largest Transport Military Plane ******"); | ||||
System.out.println ("*********************************************"); | ||||
Comment on lines
+17
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No white space before opening parenthesis. |
||||
|
||||
for (Plane plane : planes) { | ||||
if (plane instanceof MilitaryPlane) { | ||||
if (((MilitaryPlane) plane).getType() == MilitaryType.TRANSPORT) { | ||||
if (maxPlane != null && maxPlane.getMaxLoadCapacity() < plane.getMaxLoadCapacity()) { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
maxPlane = plane; | ||||
} | ||||
} | ||||
} //if | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove empty docu |
||||
else { | ||||
|
||||
} // else | ||||
Comment on lines
+29
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code can be omitted. |
||||
} //for | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove empty docu |
||||
System.out.println("model:" + maxPlane.getModel()); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No seg fault check |
||||
System.out.println("capacity:" + maxPlane.getMaxLoadCapacity()); | ||||
} | ||||
|
||||
//Constructor | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove empty docu, and please add explicit documentation on the constructor |
||||
public Airport(List<? extends Plane> planes) { | ||||
this.planes = planes; | ||||
this.printMaxTransportMilitaryPlane(); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not call a print fct in a constructor |
||||
} | ||||
|
||||
private List<? extends Plane> planes; | ||||
|
||||
public List<? extends Plane> getPlanes() { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing documentation |
||||
return planes; | ||||
} | ||||
|
||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* import are considered bad in python (no idea about java), clutter the global namespace