I have an arraylist created from an iteration
ArrayList<String> ulpList = new ArrayList<String>();
String record = id + "," + lp.getTime() + "," + lp.getLatitude() + "," + lp.getLongtitude() + "," + lp.getPoint() + ", " + lp.getDistance();
ulpList.add(record);
There will be many instances of the same id, with different times, latitudes, longitudes, points and distances. Thus I want to break the arraylist ulplist into various sublists. Then, I want to order/sort these sublists by time. After I have sorted the sublists by time, I want to perform some calculations and then join them back and output the result into a .csv file.
I just need to know how to break up the arraylist into these sublists that I want (which will be temporary) then how to sort them according to time, which is after the first ,
delimiter.
Sample output:
[[04ae46c177169feac5f697eexxxx,1418601075,1.375579,103.960797,null, 1000.0]]
[[04ae46c177169feac5f697eexxxx,1418602016,1.381164,103.966164,null, 1000.0]]
[[04ae46c177169feac5f697eexxxx,1418603148,1.381164,103.966164,null, 1000.0]]
[[04ae46c177169feac5f697eexxxx,1418601994,1.381164,103.966164,null, 1000.0]]
[[055ee328d4d297500e9a7f4cffe6xxxx,1418602721,1.313564,103.878443,null, 1000.0]]
[[055ee328d4d297500e9a7f4cffe6xxxx,1418602119,1.313564,103.878443,null, 1000.0]]
[[055ee328d4d297500e9a7f4cffe6xxxx,1418601901,1.313564,103.878443,null, 1000.0]]
[[055ee328d4d297500e9a7f4cffexxxx,1418600991,1.313564,103.878443,null, 1000.0]]
[[055ee328d4d297500e9a7f4cffe6xxxx,1418600132,1.313564,103.878443,null, 1000.0]]
[[00cd34bad39d19f8e2a335b444bxxxx,1418600273,1.345569,103.696973,null, 1000.0]]
[[04036dd2f45253bc9c24810f8e3exxxx,1418603285,1.301047,103.853357,null, 1000.0]]