-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisciplina.java
58 lines (47 loc) · 1.3 KB
/
Disciplina.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package gustavohoresteesantosbarros_atividadeavaliativa2;
/**
*
* @author gustavohorestee
*/
import java.util.ArrayList;
import java.util.List;
public class Disciplina {
private String nome;
private List<Aluno> alunos;
private List<Curso> cursos;
private List<Professor> professores;
public Disciplina(String nome) {
this.nome = nome;
this.alunos = new ArrayList<>();
this.cursos = new ArrayList<>();
this.professores = new ArrayList<>();
}
public String getNome() {
return nome;
}
public List<Aluno> getAlunos() {
return alunos;
}
public List<Curso> getCursos() {
return cursos;
}
public List<Professor> getProfessores() {
return professores;
}
public void addAluno(Aluno aluno) {
alunos.add(aluno);
aluno.addDisciplina(this);
}
public void addCurso(Curso curso) {
cursos.add(curso);
curso.addDisciplina(this);
}
public void addProfessor(Professor professor) {
professores.add(professor);
professor.addDisciplina(this);
}
}