腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
搜索
关闭
文章
问答
(8903)
视频
开发者手册
清单
用户
专栏
沙龙
全部问答
原创问答
Stack Exchange问答
更多筛选
回答情况:
全部
有回答
回答已采纳
提问时间:
不限
一周内
一月内
三月内
一年内
问题标签:
未找到与 相关的标签
筛选
重置
3
回答
Collectors
.summingInt()和
Collectors
.joining()
我的问题是:int tailsEndToEnd = cats.stream().collect(
Collectors
.summingInt(Cat::getTailLength);//(1)String allNames = cats.stream().collect(
Collectors
.joining(Cat::getName); //(2)cats.stream().collect(
Collectors
.mapping
浏览 2
提问于2022-01-09
得票数 1
回答已采纳
1
回答
Java的
Collectors
.toList()和
Collectors
.toSet()机制
如果我有HashSet,并且在某些操作中使用了.filter()流,然后执行.collect(
Collectors
.toList())操作,那么与将流收集回HashSet .collect(
Collectors
.toSetObjects List<Object> newList = originalSet.stream().filter(Object::isEnabled).collect(
Collectors
.toList())// Scenari
浏览 1
修改于2022-01-31
得票数 1
1
回答
Collectors
.summingLong和
Collectors
.counting的性能比较
和
Collectors
.summingLong(x -> 1L)的性能。比
Collectors
.summingLong慢3倍。
Collectors
.summingLong 我们有3个循环遍历数组并计数。请注意,
Collectors
.summingLong的GC压力比
Collectors
.counting高2.5。这还不太清楚(我只能猜测,我们将中间值存储在
Collectors
.counting中的堆栈中)。
浏览 2
修改于2018-01-30
得票数 9
回答已采纳
1
回答
Collectors
.toMap() keyMapper
类似于:有什么帮助吗? .collect(
Collectors
.toMap(m->m.getDateTime
浏览 0
提问于2017-10-29
得票数 5
回答已采纳
2
回答
如何将
Collectors
.collectingAndThen与
Collectors
.groupingBy结合使用
我使用了两个步骤,首先创建一个频率图,然后计算相对百分比和格式: input.stream().collect(
Collectors
.groupingBy(Function.identity(),
Collectors
.counting())); .collect(
浏览 6
提问于2022-04-09
得票数 2
回答已采纳
2
回答
Collectors
.reducing上市
html), User(name=sam, languages=java, js)]List<User> l = list.stream() u -> u.name, new User(u1.name, u1.languages= null) .map(user -> user.get())
浏览 3
修改于2020-05-21
得票数 8
回答已采纳
2
回答
Collectors
.groupingBy与map
persons.stream() .collect(
Collectors
.groupingBy
浏览 2
修改于2015-01-20
得票数 2
回答已采纳
2
回答
stream().collect(
Collectors
.toSet()) vs stream().distinct().collect(
Collectors
.toList())
在list.stream().collect(
Collectors
.toSet()) and list.stream().distinct().collect(
Collectors
.toList())中
浏览 0
修改于2018-02-27
得票数 11
1
回答
Collectors
.toSet()和HashSet
取下面的示例代码行:public static <T> Collector<T, ?
浏览 1
修改于2017-08-11
得票数 103
回答已采纳
1
回答
Collectors
.toSet实现细节
我在查看jdk-8下的
Collectors
.toSet实现时,几乎看到了显而易见的事情: public static <T> Collector<T, ?
浏览 3
修改于2017-05-23
得票数 6
回答已采纳
2
回答
Collectors
.toMap不编译
这段代码不编译System.out.println(pairs.stream().collect(
Collectors
.toMap(x -> x.split("=")[0], x -> x.split("=")[1])));但是这个编译得很好 List<Strin
浏览 4
修改于2014-11-12
得票数 8
回答已采纳
2
回答
Java8
Collectors
.groupingBy
我想groupingBy一个基于LocalDateTime的集合,但我只想得到时间,而不是分钟,秒. .collect(
Collectors
.groupingBy(cp -> getUpdateLocalDate
浏览 0
修改于2018-10-12
得票数 7
回答已采纳
1
回答
Java :重写
Collectors
.mapping的返回类型
extends String>> test = listOfTipusIdentificadorPacient.stream()
Collectors
.mapping(TipusIdentificadorPacient::getUse,
Collectors
.toList()));类型不匹配:不能从Map<String、List&
浏览 2
修改于2021-09-01
得票数 3
回答已采纳
2
回答
列表到Map -
Collectors
.toMap()
使用
Collectors
.toMap()是可能的 例如。
浏览 3
修改于2016-11-24
得票数 2
回答已采纳
4
回答
收集到地图中的
Collectors
.toMap()和
Collectors
.groupingBy()之间的差异
我使用了
Collectors
.toMap(),但它没有编译: .collect(
Collectors
.toMap(Point::getParentId, c -> c));
浏览 16
修改于2020-03-10
得票数 41
回答已采纳
1
回答
流中有"
Collectors
.toList()“的
Collectors
.toList解析参数不能作为expressionString工作?
).getValue(context)parser.parseExpression("#configList.stream().map(o -> o.ruleId).collect(
Collectors
.toList
浏览 5
提问于2020-11-08
得票数 0
回答已采纳
2
回答
Collectors
.groupingBy进入对象列表?
List<Day> days = timeEntries.stream().collect(
Collectors
.groupingBy(...?
浏览 0
修改于2016-01-24
得票数 4
回答已采纳
1
回答
Collectors
.summingInt() vs mapToInt().sum()
.> mapFunc = ... int sum = stream().mapToInt
浏览 2
修改于2016-05-04
得票数 26
回答已采纳
1
回答
summarizingInt与
Collectors
.summarizingInt的差异?
x.getAmount()).summaryStatistics();
Collectors
.summarizingInt
浏览 0
修改于2016-12-06
得票数 4
回答已采纳
1
回答
Collectors
.summingInt中的减法
String,Integer> hm = new HashMap<String,Integer>(); .collect(
Collectors
.groupingBy(MonitoredData::getActivity,
Collectors
.summingInt( (MonitoredData::getEndTimeSeconds
浏览 0
提问于2018-05-15
得票数 0
回答已采纳
第 2 页
第 3 页
第 4 页
第 5 页
第 6 页
第 7 页
第 8 页
第 9 页
第 10 页
第 11 页
点击加载更多
领券