So, I’m attempting to create a list of values to be loaded during run time, and different sets of these values will need to be referable by the data holder and by the index within the holder. I was initially leaning towards an ArrayList since the data will be various types (int, floats, and strings) and I’ll want to refer to the whole set by name.
However, in looking into ArrayLists I come upon scores of comments and such that are outright derisive of ArrayLists as being outmoded, outdated, or poor performance-wise.
Sadly, not one of them can actually be bothered to suggest what I should use instead that has the same functionality. I can only assume there’s another data type I should be using, but I don’t know what to look for so I can’t find it.
My requirements include:
Must support multiple data types within the same container.
Must be easy to reference an individual piece of data without having to pull apart the container with a custom function
My Wants:
I’d like the individual slots within the container to be strongly typed, so I don’t have to cast the data out of it in code.
Ideally:
I’d like to be able to label these fields within the container and be able to reference the field via dot notation.
Container does not need to be dynamically sized, as the data is static and just referenced by the code elsewhere.
Any ideas?