File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ package ConcurrentSkipListSet ;
2+
3+ import java .util .concurrent .ConcurrentSkipListSet ;
4+ import java .util .Collection ;
5+ public class ConcurrentSkipListSet4 {
6+ public static void main (String [] args ) {
7+
8+ Collection <Float > set = new ConcurrentSkipListSet <>();
9+
10+ set .add (1.09f );
11+ set .add (2.89f );
12+ set .add (3.90f );
13+ set .add (4.98f );
14+ System .out .println ("===========================" );
15+ //parallelStream
16+ set .parallelStream ().forEach (System .out ::println );
17+ System .out .println ("===========================" );
18+ set .parallelStream ().forEach (s -> System .out .println (s ));
19+
20+ System .out .println ("===========================" );
21+ //stream
22+ set .stream ().forEach (System .out ::println );
23+ System .out .println ("===========================" );
24+ set .stream ().forEach (s -> System .out .println (s ));
25+ System .out .println ("===========================" );
26+
27+ //removeIf
28+ System .out .println ("===========================" );
29+ set .removeIf (s -> s > 3.0f );
30+ System .out .println (set );
31+ System .out .println ("===========================" );
32+
33+
34+
35+ }
36+
37+ }
You can’t perform that action at this time.
0 commit comments