You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StopsDbo.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package com.rthoni.stssaguenay.dbo;
  2. import android.util.Pair;
  3. import com.luticate.utils.dbo.LuDbo;
  4. import com.luticate.utils.dbo.LuPaginatedDbo;
  5. import org.json.JSONArray;
  6. import org.json.JSONException;
  7. import org.json.JSONObject;
  8. import java.util.HashMap;
  9. import java.util.List;
  10. import java.util.Vector;
  11. /**
  12. * Created by robin on 9/29/16.
  13. */
  14. public class StopsDbo extends LuDbo {
  15. public static class PaginatedStopsDbo extends LuPaginatedDbo<StopsDbo>
  16. {
  17. }
  18. // @Override
  19. // public void fromJson(JSONObject json) throws JSONException {
  20. // _name = json.getString("name");
  21. // _routes = new Vector<>();
  22. // JSONArray routes = json.getJSONArray("routes");
  23. // for (int i = 0; i < routes.length(); ++i) {
  24. // _routes.add(routes.getString(i));
  25. // }
  26. // _id = json.getString("id");
  27. // _posX = json.getDouble("posX");
  28. // _posY = json.getDouble("posY");
  29. // }
  30. //
  31. // @Override
  32. // public HashMap<String, Object> toArray() {
  33. // HashMap<String, Object> map = new HashMap<>();
  34. // map.put("name", _name);
  35. // map.put("routes", _routes);
  36. // map.put("id", _id);
  37. // map.put("posX", _posX);
  38. // map.put("posY", _posY);
  39. // return map;
  40. // }
  41. protected String _name;
  42. protected List<String> _routes;
  43. protected String _id;
  44. protected double _posX;
  45. protected double _posY;
  46. public String getFullName()
  47. {
  48. return String.format("%s - %s", _id, _name);
  49. }
  50. public String getName() {
  51. return _name;
  52. }
  53. public void setName(String name) {
  54. _name = name;
  55. }
  56. public List<String> getRoutes() {
  57. return _routes;
  58. }
  59. public void setRoutes(List<String> routes) {
  60. _routes = routes;
  61. }
  62. public String getId() {
  63. return _id;
  64. }
  65. public void setId(String id) {
  66. _id = id;
  67. }
  68. public double getPosX() {
  69. return _posX;
  70. }
  71. public void setPosX(double posX) {
  72. _posX = posX;
  73. }
  74. public double getPosY() {
  75. return _posY;
  76. }
  77. public void setPosY(double posY) {
  78. _posY = posY;
  79. }
  80. }