Guest User

Untitled

a guest
Jan 20th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. public class Lecture {
  2.  
  3.     private String titel;
  4.     private int maxTeilnehmer;
  5.     private Lecturer dozent;
  6.     private LectureRoom hoersaal;
  7.  
  8.     public Lecture(String titel, int maxTeilnehmer) {
  9.  
  10.         this.titel = titel;
  11.         this.maxTeilnehmer = maxTeilnehmer;
  12.  
  13.     }
  14.  
  15.     public void setDozent(Lecturer dozent) {
  16.         if (this.titel == dozent.getFachgebiet()) {
  17.             this.dozent = dozent;
  18.         } else {
  19.             System.out.println("Dozent ist ein noob in diesem Gebiet");
  20.         }
  21.     }
  22.  
  23.     public void setHoersaal(LectureRoom hoersaal) {
  24.         if (this.maxTeilnehmer >= hoersaal.getAnzPlaetze()) {
  25.             this.hoersaal = hoersaal;
  26.         } else {
  27.             System.out.println("Raum zu klein");
  28.         }
  29.     }
  30.  
  31.  
  32.  
  33.  
  34.     public String getTitel() {
  35.         return this.titel;
  36.     }
  37.  
  38.     public int getMaxTeilnehmer() {
  39.         return this.maxTeilnehmer;
  40.     }
  41.  
  42.     public Lecturer getDozent() {
  43.         return this.dozent;
  44.     }
  45.  
  46.     public LectureRoom getHoersaal() {
  47.         return this.hoersaal;
  48.     }
  49.  
  50. }
Add Comment
Please, Sign In to add comment