You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
923 B

  1. package hs.fulda.de.ci.exam.project;
  2. import java.util.HashSet;
  3. public class Aircraft {
  4. private String name;
  5. private String model;
  6. private int manYear;
  7. private HashSet<Flight> flights = new HashSet<Flight>();
  8. public Aircraft(String name, String model, int manufacturingYear) {
  9. this.name = name;
  10. this.model = model;
  11. this.manYear = manufacturingYear;
  12. }
  13. public String getName() {
  14. return this.name;
  15. }
  16. public String getModel() {
  17. return this.model;
  18. }
  19. public int getManYear() {
  20. return this.manYear;
  21. }
  22. public HashSet<Flight> getFlights() {
  23. return this.flights;
  24. }
  25. public void addFlight(Flight flight) {
  26. flights.add(flight);
  27. }
  28. @Override
  29. public String toString() {
  30. return "Aircraft = {" + "name=" + name + '\'' + ", model=" + model + ", manufacturingYear='" + manYear +'}';
  31. }
  32. }