I'm using ArrayList
to store CustomObjects
, problem is that it takes time to find an object in that list in order to remove it. (around 100K elements).
I'm forced to use ArrayList
as I have to keep the order as is.
I was thinking of updating an HashMap<Object, Integer>
to keep track of indexes.
Problem is when I delete an element in the list, i also have to update all indexes in my map, which is slow !
I also must be able to find elements in my list by both Index and Object.
If you can lead me to some sort of solutions :)
Thanks.
EDIT: I implemented from scratch needed LinkedList, its working like a charm, thanks for your help everyone tho :)