Combine Array value with same key

I have a list which hold all my data: `setData` List> setData = new ArrayList>(); Map set; and the value are added like this (this happens in a loop, when it is iterating through a cursor): set = new HashMap(); set.put("value", value); set.put("day", day); setData.add(set); The Array is sorted **afterwards**, from the lowest value for 'day' to the highest value for 'day'. **My question:** I want to combine all 'values' with the same 'day', the 'value' need to be added or subtracted, that my final Array only holds one value for each day.
Seems like a complex structure. Did you consider using SQLite?

以上就是Combine Array value with same key的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准