当前位置:网站首页>Analyze whether there is duplicate data in the list and repeat it several times
Analyze whether there is duplicate data in the list and repeat it several times
2022-06-28 11:23:00 【soha_ dong】
There is one List Stored in bean object ,
List<CarPeccancy.ROWSDETAILBean> list = peccancy.getROWS_DETAIL();Each of them bean The data is different , According to bean Of name Attribute to determine whether there is duplicate data .
Then we create a new one List Collective storage name The value of the property
List<String> carList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
carList.add(list.get(i).getCarnumber());
}Count each one name Number of occurrences
int number = 0;
int not = 0;
for (String temp : carList) {
int frequency = Collections.frequency(carList, temp);
if (frequency > 1) {
number++;
} else {
not++;
}
}
System.out.println(" Duplicate data :" + number);
System.out.println(" No duplicate data :" + not);边栏推荐
- 论文阅读 (59):Keyword-Based Diverse Image Retrieval with Variational Multiple Instance Graph
- Calculate time using calendar
- Solve the problem of reading package listsdonebuilding dependency treereading state informationdone
- Making and using of dynamic library (shared library)
- Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph
- [semidrive source code analysis] [x9 chip startup process] 32 - play module analysis - RTOS side
- This Exception was thrown from a job compiled with Burst, which has limited exception support. 报错
- JS基础2
- Metersphere implements UI automation elements that are not clickable (partially occluded)
- Get current system date
猜你喜欢
This Exception was thrown from a job compiled with Burst, which has limited exception support. 报错

科研丨Web of Science检索技巧

QML控件类型:TabBar

静态库的制作和使用

ThreadLocal的简单理解

2022中国信通院首届业务与应用安全发展论坛成功召开!

【实战】1364- 实现一个完美的移动端瀑布流组件(附源码)

Debug debugging in katalon

Training notice | special training notice on epidemic prevention and security prevention for overseas Chinese funded enterprises, institutions and personnel in 2022

还在用 SimpleDateFormat 做时间格式化?小心项目崩掉!
随机推荐
功能真花哨,价格真便宜!长安全新SUV真实力到底怎样?
Redis6 1: what problems can be solved by the introduction of NoSQL and redis?
How to use output in katalon
Katalon global variable is referenced in testobject
JS基础10
培训通知|2022年境外中资企业机构及人员疫情防控和安全防范专题培训通知
JS foundation 6
Fancy features and cheap prices! What is the true strength of Changan's new SUV?
Docker modifies the user name and password of MySQL
【剑指Offer】49. 丑数
MytipartFile与File的相互转换
静态库的制作和使用
【agora】get 一个 agora_refptr 对象的用法示例
ThreadLocal的简单理解
Characteristics of solar wireless LED display
将浏览器中的文件 url转换为File流
vsftpd服务的部署及优化
This Exception was thrown from a job compiled with Burst, which has limited exception support. report errors
合约量化交易系统开发 | 合约量化APP开发(现成案例)
Metersphere uses JS to refresh the current page