-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuanLyDiem.java
45 lines (35 loc) · 1.2 KB
/
QuanLyDiem.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
package com.thanhttt.baitaplon;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class QuanLyDiem {
private List<DiemCuaTVHD> danhSachDiem = new ArrayList<>();
public QuanLyDiem() {
}
public QuanLyDiem(List<DiemCuaTVHD> danhSachDiem) {
this.danhSachDiem = danhSachDiem;
}
public QuanLyDiem(DiemCuaTVHD... diemTVHD) {
this.danhSachDiem.addAll(Arrays.asList(diemTVHD));
}
public List<DiemCuaTVHD> getDanhSachDiem() {
return danhSachDiem;
}
public void setDanhSachDiem(List<DiemCuaTVHD> danhSachDiem) {
this.danhSachDiem = danhSachDiem;
}
public void them(DiemCuaTVHD... diemTVHD) {
this.danhSachDiem.addAll(Arrays.asList(diemTVHD));
}
public void xoa(DiemCuaTVHD diemTVHD){
this.danhSachDiem.removeIf(d -> d.equals(diemTVHD) == true);
}
public List<Double> diemBaoCao(QuanLyDiem list, BaoCao bc){
List<Double> diem = new ArrayList<>();
for (var x: list.getDanhSachDiem()){
if (x.getBaoCao().equals(bc))
diem.add(x.getDiem());
}
return diem;
}
}