I need to maintain key/value pairs. I need to maintain the insertion order also. I know two approaches to do it:
Using ArrayList where each object would be of type entity containing key/value pairs as in ListData described below:
class ListData{
String key;
ArrayList<MyData> dataList;
}
Using LinkedHashMap for maintaing the key value pairs.
Is there any performance/speed problem in terms of speed in using LinkedHashMap?
Can someone suggest the best approach to do this?