Agenda.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package src.agenda;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. /**
  5. * Created by gjoosen on 06/02/15.
  6. */
  7. public class Agenda {
  8. private List<Stage> stages;
  9. private List<Artist> artists;
  10. private List<Act> acts;
  11. public Agenda() {
  12. this.stages = new ArrayList<Stage>();
  13. this.artists = new ArrayList<Artist>();
  14. this.acts = new ArrayList<Act>();
  15. this.testAgenda();
  16. }
  17. private void testAgenda(){
  18. //stages
  19. this.stages.add(new Stage("Main stage"));
  20. this.stages.add(new Stage("Tent stage"));
  21. //artiesten
  22. this.artists.add(new Artist("Iron Maiden", "Heavy metal"));
  23. this.artists.add(new Artist("Slayer", "Tresh metal"));
  24. this.artists.add(new Artist("Sabaton", "Power metal"));
  25. //acts
  26. this.acts.add(new Act(this.stages.get(0), "Heavy metal", new Time(21, 00), new Time(23, 00), this.artists.get(0)));
  27. this.acts.add(new Act(this.stages.get(1), "Test metal" ,new Time(10, 10), new Time(10, 50), this.artists.get(1)));
  28. this.acts.add(new Act(this.stages.get(0), "Power metal" ,new Time(10, 10), new Time(10, 50), this.artists.get(2)));
  29. System.out.println(this);
  30. }
  31. public List<Stage> getStages() {
  32. return stages;
  33. }
  34. public void addStage(Stage stage){
  35. this.stages.add(stage);
  36. }
  37. public void addArtist(Artist artist){
  38. this.artists.add(artist);
  39. }
  40. public void addAct(Act act){
  41. this.acts.add(act);
  42. }
  43. public List<Artist> getArtists() {
  44. return artists;
  45. }
  46. public List<Act> getActs() {
  47. return acts;
  48. }
  49. @Override
  50. public String toString(){
  51. String string = "";
  52. for(Act act: this.acts){
  53. string += act + "\n\n";
  54. }
  55. return string;
  56. }
  57. }