12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- package com.rthoni.stssaguenay.dbo;
-
- import android.util.Pair;
-
- import com.luticate.utils.dbo.LuDbo;
- import com.luticate.utils.dbo.LuPaginatedDbo;
-
- import org.json.JSONArray;
- import org.json.JSONException;
- import org.json.JSONObject;
-
- import java.util.HashMap;
- import java.util.List;
- import java.util.Vector;
-
- /**
- * Created by robin on 9/29/16.
- */
- public class StopsDbo extends LuDbo {
-
- public static class PaginatedStopsDbo extends LuPaginatedDbo<StopsDbo>
- {
- }
-
- @Override
- public void fromJson(JSONObject json) throws JSONException {
- _name = json.getString("name");
- _routes = new Vector<>();
- JSONArray routes = json.getJSONArray("routes");
- for (int i = 0; i < routes.length(); ++i) {
- _routes.add(routes.getString(i));
- }
- _id = json.getString("id");
- _posX = json.getDouble("posX");
- _posY = json.getDouble("posY");
- }
-
- @Override
- public HashMap<String, Object> toArray() {
- return null;
- }
-
- protected String _name;
-
- protected List<String> _routes;
-
- protected String _id;
-
- protected double _posX;
-
- protected double _posY;
-
- public String getFullName()
- {
- return String.format("%s - %s", _id, _name);
- }
-
- public String getName() {
- return _name;
- }
-
- public void setName(String name) {
- _name = name;
- }
-
- public List<String> getRoutes() {
- return _routes;
- }
-
- public void setRoutes(List<String> routes) {
- _routes = routes;
- }
-
- public String getId() {
- return _id;
- }
-
- public void setId(String id) {
- _id = id;
- }
-
- public double getPosX() {
- return _posX;
- }
-
- public void setPosX(double posX) {
- _posX = posX;
- }
-
- public double getPosY() {
- return _posY;
- }
-
- public void setPosY(double posY) {
- _posY = posY;
- }
- }
|