I want to have a List
or Array
of some sort, storing this information about each country:
If you frequently need to do a lookup by continent, I'd simply make a series of immutable lists, one for each continent, and populate them accordingly. The list of country-data for a continent is probably not going to change frequently enough for the cost of rebuilding such an array to be rebuilt when something needs to be altered.
Also, if you're willing to do the country-continent classification manually, the rest is automatic and can be done programmatically.