I have a table in which I am keeping track of a large set of subsets of the rows. My problem is that users are allowed to add and subtract rows from the table. So if I have a list of rows: 1,2,3 I am in good shape until row 2 is deleted. Long ago in another language, I could handle that easily because the table maintained an internal row id and an external row id. So I just defined my sets in terms of the internal id and used a function that returned the external id. I've been looking for something like that in
Java. I found functions related to sorting the table, but so far nothing that would help with adding and deleting rows.
Something like:
this won't compile of course, as I haven't found functions that map an absolute address to a relative one.
Is there anything like this in Java?
I can loop through all my clusters and update every reference each time a row is added or deleted, but I was hoping for something cleaner than that.