Fix folder routes and package location

This commit is contained in:
Reynaldo Reyes
2016-03-13 23:13:58 -04:30
parent 0a593484b4
commit 67fbbed7c4
25 changed files with 84 additions and 62 deletions

View File

@@ -0,0 +1,41 @@
package massiveattendancescannerapplication.Data;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class Section {
public String name;
public String semester;
public List<Student> student;
public Section (String _name, String _semester, List<Student> _student){
name = _name;
semester = _semester;
student = _student;
}
public static Section createFromJSON(JSONObject json) throws JSONException {
String name = json.getString("name");
String semester = json.getString("semester");
List<Student> qStudents = new ArrayList<Student>();
if (json.has("Students")){
JSONArray students = json.getJSONArray("Students");
for (int k = 0; k < students.length(); k++)
{
qStudents.add(Student.createFromJSON(students.getJSONObject(k)));
}
}
return new Section(name, semester, qStudents);
}
}