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;
	}

}

@@ -23,16 +23,49 @@
 .data;%0A%0A
+import java.util.LinkedHashMap;%0A%0A
 import o
@@ -172,25 +172,46 @@
 %09public 
+LinkedHashMap%3CInteger,
 Species
-%5B%5D
+%3E
  getAll(
@@ -220,25 +220,46 @@
 %7B%0A%09%09
+LinkedHashMap%3CInteger,
 Species
-%5B%5D
+%3E
  species
  = n
@@ -258,23 +258,55 @@
 cies
- = new 
+List = %0A%09%09%09%09new LinkedHashMap%3CInteger,
 Species
-%5B
+%3E(
 data
@@ -314,17 +314,17 @@
 length()
-%5D
+)
 ;%0A%09%09for 
@@ -364,26 +364,41 @@
 +) %7B%0A%09%09%09
+try %7B%0A%09%09%09%09Species 
 species
-%5Bi%5D
  = new S
@@ -407,25 +407,16 @@
 cies();%0A
-%09%09%09try %7B%0A
 %09%09%09%09spec
@@ -422,11 +422,8 @@
 cies
-%5Bi%5D
 .set
@@ -451,16 +451,68 @@
 ct(i));%0A
+%09%09%09%09speciesList.put(species.getId(), species);%0A%09%09%09%09%0A
 %09%09%09%7D cat
@@ -584,16 +584,20 @@
  species
+List
 ;%0A%09%7D%0A%0A%7D%0A

Implement getAll to return Hash