I have a simple solution, but would like to find a more streamlined solution, if I were to update my database.
Right now I am looking for ten floats, using this code I have no problem, these take the ten floats I have stored in my database.
private float[] getRandomData() {
return new float[] { 63, 82, 202, 41, 322, 123, 53, 178, 126, 1393 };
}
What I would rather do, is take my database, and add the stored values to the array.
Something along the lines of...
private float[] getPopulation() {
twcCountryData populationData;
for (int i =0; i < countryDataList.size(); i++) {
populationData = countryDataList.get(i);
populationData.getPopulation();
}
return new float[] {};
}
I am looking to basically end up with the same outcome as the first codeblock, but iterating through my datalist adding to the new float, allowing for future database additions, to take care of themselves.