package J20250724.demo02_function_program;

import java.util.*;
import java.util.stream.Stream;

/**
 * @author WanJl
 * @version 1.0
 * @title Demo02_getSream
 * @description
 * @create 2025/7/24
 */
public class Demo02_getStream {
    public static void main(String[] args) {
        //Collection体系的集合
        List<String> list=new ArrayList<>();
        Stream<String> listStream = list.stream();

        Set<String> set=new HashSet<>();
        Stream<String> setStream = set.stream();

        //Map体系集合
        Map<String ,Integer> map=new HashMap<>();
        //把所有的key生成流
        Stream<String> keyStream = map.keySet().stream();
        //把所有的value生成流
        Stream<Integer> valueStream = map.values().stream();
        //把所有的键值对对象生成流
        Stream<Map.Entry<String, Integer>> entryStream = map.entrySet().stream();

        //数组
        String[] strArray={"hello","world","java","lambda","stream"};
        Stream<String> arrayStream = Arrays.stream(strArray);
        //同种数据类型的多个数据

        Student s1=new Student(1,"张三");
        Student s2=new Student(1,"张三");
        Student s3=new Student(1,"张三");
        Student s4=new Student(1,"张三");
        Stream<Student> objectStream = Stream.of(s1, s2, s3, s4);
        Stream<Integer> integerStream = Stream.of(1, 2, 3, 4, 6, 78, 1, 658);

    }
}
