package org.azavea.otm.data;

import org.json.JSONException;

public class SpeciesContainer extends ModelContainer<Species> {

	@Override
	public Species[] getAll() {
		Species[] species = new Species[data.length()];
		for (int i = 0; i < data.length(); i++) {
			species[i] = new Species();
			try {
				species[i].setData(data.getJSONObject(i));
			} catch (JSONException e) {
				e.printStackTrace();
			}
		}
		return species;
	}

}

package org.azavea.otm.data;

import java.util.LinkedHashMap;

import org.json.JSONException;

public class SpeciesContainer extends ModelContainer<Species> {

	@Override
	public LinkedHashMap<Integer,Species> getAll() {
		LinkedHashMap<Integer,Species> speciesList = 
				new LinkedHashMap<Integer,Species>(data.length());
		for (int i = 0; i < data.length(); i++) {
			try {
				Species species = new Species();
				species.setData(data.getJSONObject(i));
				speciesList.put(species.getId(), species);
				
			} catch (JSONException e) {
				e.printStackTrace();
			}
		}
		return speciesList;
	}

}

Implement getAll to return Hash
Implement getAll to return Hash

Species come back ordered by common name.  Preserving this sorting lets
us change the default sort order by just changing the API, which we have
more control over than for installed applications.
