Say I had a an enum called Planets that contained VENUS, EARTH, and MARS. I will have a lot of array lists that will hold at most one of each type. I want to keep each array list sorted at all times in order from VENUS, EARTH, and MARS.
Would I need to use a comparator for this? Is there a way to keep them sorted automatically after an insert, or will I need to call sort after each insert? Will I need to keep an int value within each type to distinguish their order?
Offer alternative advice if you have any, thank you.