forked from sermakov/JavaPatternMirea
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsk2.java
More file actions
Latest commit
45 lines (37 loc) · 1.17 KB
/
Copy pathtsk2.java
File metadata and controls
45 lines (37 loc) · 1.17 KB
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
packagesome;
importjava.time.LocalDate;
importjava.util.ArrayList;
importjava.util.concurrent.atomic.AtomicReference;
publicclasstsk2 {
staticvoidprt(Objecta) {
System.out.println(a);
}
staticrecordhm(
intag,
Stringfn,
Stringln,
LocalDatebd,
intw
) {}
publicstaticvoidmain(String[] args) {
finalvara = newArrayList<hm>();
a.add(newhm(1, "a", "a",
LocalDate.of(1999, 2, 1), 10));
a.add(newhm(2, "b", "b",
LocalDate.of(1998, 1, 1), 20));
a.add(newhm(3, "c", "c",
LocalDate.of(1997, 1, 1), 30));
a.add(newhm(4, "d", "d",
LocalDate.of(1996, 1, 1), 40));
a.add(newhm(5, "e", "e",
LocalDate.of(1999, 1, 5), 50));
varc = a.stream().map(b -> newhm(b.ag, b.fn, b.ln, b.bd, b.w - 5));
c = c.filter(d -> d.bd().isBefore(LocalDate.of(1999, 1, 3)));
var_a = c.toList();
prt(_a);
vard = newAtomicReference<String>();
d.set("");
_a.forEach(e -> d.set(d.get() + e.ln + ' '));
prt(d.get());
}
}