Act.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package agenda;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. /**
  5. * Created by gjoosen on 06/02/15.
  6. */
  7. public class Act {
  8. private List<Artist> artists;
  9. private Stage stage;
  10. private String genre;
  11. private ActTime actTime;
  12. public Act(Stage stage, String genre, Time startTime, Time endTime, Artist... artists){
  13. this.stage = stage;
  14. this.genre = genre;
  15. this.actTime = new ActTime(startTime, endTime);
  16. this.artists = new ArrayList<Artist>();
  17. for(Artist artist: artists) {
  18. this.artists.add(artist);
  19. }
  20. }
  21. /**
  22. * * returns a list with all the artists that are in the act.
  23. * @return all artists.
  24. */
  25. public List<Artist> getArtists() {
  26. return artists;
  27. }
  28. /**
  29. * * returns the stage the act plays on.
  30. * @return stage
  31. */
  32. public Stage getStage() {
  33. return stage;
  34. }
  35. /**
  36. * * returns the genre of the act.
  37. * @return the genre of the act.
  38. */
  39. public String getGenre() {
  40. return genre;
  41. }
  42. /**
  43. * * return the act time.
  44. * @return the act time in minutes
  45. */
  46. public int getActTime() {
  47. return this.actTime.getLength();
  48. }
  49. @Override
  50. public String toString(){
  51. String string = "";
  52. string+="Artists: ";
  53. for(Artist artist: this.artists){
  54. string += artist.getName() + "\n";
  55. }
  56. string+= "genre: " + this.genre + "\n";
  57. string+= "stage: " + this.stage.getName() + "\n";
  58. string+= this.actTime;
  59. return string;
  60. }
  61. }