Java和Excel中的列表批处理给出了不同的结果
我需要批处理具有类似客户端id的元素(字符串类型,但目前只有数字值,如“12345”、“235134”等)
Map<String, List<Client>> _batched = new HashMap<String, List<Client>>();
for (Client c : _Clients)
{
String id = c.getIdClient();
List<Client> clients = _batched.get(id);
if(_clients == null){
clients = new ArrayList<Client>();
_batched.put(id, clients);
}
clients.add(c);
}
问题是,当我将这个函数与Excel(=SUM(IF(FREQUENCY(C2:C618,C2:C618)>0,1))
)的结果进行比较时,会得到不同的结果,即526和519
我的代码有问题吗
# 1 楼答案
你的问题是:
在名为
pois
的变量中创建一个新数组,然后将变量_clients
的内容放入_batched
。输入pois
的值会发生什么变化我不明白这怎么不是空指针异常