java - Index the ID number in an ArrayList -


so, have arraylist taken .txt file. displays following details:

id car manufacturer car type colour *blank line* 

for example:

21 vauxhall corsa red  19 vauxhall corsa blue  18 vauxhall corsa white 

i curious how make id "index" of arraylist, if car deleted or added arraylist, automatically adjust id number.

you'll need set id primary key arraylist. can creating arraylist contains hashmap objects

arraylist<hashmap<int, carobject>> = new arraylist()

sorting becomes question of iterating through integer ids in arraylist objects


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -