Following situation: I need a container for data with a rowindex. Currently we use a normal ArrayList within tablemodels and update tablerownumbers by hand (with crazy algorithms, to keep them updated after adding, deleting, moving data within that container.
After finding the third bug updating these tablerows I thought about finally using a different container to keep them updated automatically. My first thought was using a LinkedList. Only thing I dislike is, that within a LinkedList I cant move items without deleting/readding them, but still seems satisfying.
The Rowheader itself is an own table and needs to be updated for every event, to keep both in sync.

Just wondering, if you can recommend alternatives. So I am curious what kind of container would you use?
thanks,
ymene
I’m not sure I fully understand the question. But supposing you have a
List<Person>, and you need a table displaying the row number, the person first name, and the person last name, you don’t need any index in the Person or even in the list to do that:An ArrayList would be much more efficient than a LinkedList, since indexed access is O(1) rather than O(n) for a LinkedList.