1. public class Journal
  2. {
  3. private String titel;
  4. private String publisher;
  5. private Integer volume;
  6. private String year;
  7. private ArrayList<String>circulationList;
  8.  
  9. /**
  10. * Constructor for objects of class Journal
  11. */
  12. public Journal(String newTitel, String newPublisher, Integer newVolume, String newYear)
  13. {
  14. titel= newTitel;
  15. publisher= newPublisher;
  16. volume= newVolume;
  17. year= newYear;
  18. circulationList =new ArrayList<String>();
  19.  
  20. }
  21.  
  22. public void setTitel(String newTitel)
  23. {
  24. titel= newTitel;
  25. }
  26. public String getTitel()
  27. {
  28. return titel;
  29. }
  30. public void setPublisher(String newPublisher)
  31. {
  32. publisher= newPublisher;
  33. }
  34. public String getPublisher()
  35. {
  36. return publisher;
  37. }
  38. public void setVolume(Integer newVolume)
  39. {
  40. volume= newVolume;
  41. }
  42. public Integer volume()
  43. {
  44. return volume;
  45. }
  46. public void setYear(String newYear)
  47. {
  48. year=newYear;
  49. }
  50. public String getYear()
  51. {
  52. return year;
  53. }
  54. /**
  55. * Exercise 2.
  56. */
  57.  
  58. /**
  59. * Method for add employee
  60. */
  61. public void addEmployee (String empName){
  62. if (circulationList.contains(empName))
  63. {System.out.println("You are already in the system");}
  64. circulationList.add(empName);
  65. }
  66.  
  67. /**
  68. * Method for print the circulations list
  69. */
  70. public void printingTheCirulationListOnTheScreen(){
  71. for ( String a : circulationList ){
  72. System.out.println(a);
  73. }
  74. }
  75.  
  76. /**
  77. * Method for removing an employee
  78. */
  79. public void removeEmployee(String empName){
  80. circulationList.remove(empName);
  81. }
  82.  
  83. }