-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuanLySinhVienLamBaoCao.java
48 lines (40 loc) · 1.41 KB
/
QuanLySinhVienLamBaoCao.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
/*
* 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 com.thanhttt.baitaplon;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
*
* @author Admin
*/
public class QuanLySinhVienLamBaoCao {
private List<SinhVienLamBaoCao> danhSachSVLamBaoCao = new ArrayList<>();
public void them(SinhVienLamBaoCao ...s){
this.danhSachSVLamBaoCao.addAll(Arrays.asList(s));
}
public void xoa(SinhVienLamBaoCao s){
this.danhSachSVLamBaoCao.removeIf(sv -> sv.equals(s) == true);
}
public List<SinhVienLamBaoCao> getDanhSachSVLamBaoCao() {
return danhSachSVLamBaoCao;
}
public void setDanhSachSVLamBaoCao(List<SinhVienLamBaoCao> ds) {
this.danhSachSVLamBaoCao = ds;
}
public List<SinhVienLamBaoCao> getDSTheoBaoCao(String maBC){
List<SinhVienLamBaoCao> kq = new ArrayList<>();
for (SinhVienLamBaoCao sv: this.danhSachSVLamBaoCao)
if (sv.getBaoCao().getMaBC() == maBC)
kq.add(sv);
return kq;
}
public void hienThi(){
for (SinhVienLamBaoCao sv: danhSachSVLamBaoCao){
sv.hienThi();
System.out.println("--------------");
}
}
}