Guest User

Untitled

a guest
Nov 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.97 KB | None | 0 0
  1. package com.example.rodrigosilva.rodrigosilva_mapd711_assignment4;
  2.  
  3. import com.google.android.gms.maps.model.LatLng;
  4.  
  5. import java.io.Serializable;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8.  
  9. public class CollegeData implements Serializable {
  10.  
  11. public ArrayList<College> getMockupData() {
  12. return new ArrayList<College>(){{
  13. add(
  14. new College("Algoquin",
  15. new ArrayList<Campus>(){{
  16. add(new Campus("Ottawa", "1385 Woodroffe Avenue Ottawa, ON, K2G1V8", new LatLng(45.3502599,-75.75587730000001)));
  17. add(new Campus("Perth", "7 Craig Street Perth, ON, K7H1X7", new LatLng(44.9029885,-76.23814800000002)));
  18. add(new Campus("Pembroke", "1 College Way Pembroke, ON, K8A0C8", new LatLng(45.826451,-77.12059999999997)));
  19. }}));
  20. add(
  21. new College("Cambrian",
  22. new ArrayList<Campus>(){{
  23. add(new Campus("Main", "1400 Barrydowne Road Sudbury, ON, P3A3V", new LatLng(46.5297834,-80.9411311)));
  24. add(new Campus("Espanola", "91 Tudhope Street, Suite 101 Espanola, ON, P5E1S6", new LatLng(46.2658076,-81.77107590000003)));
  25. add(new Campus("Manitoulin", "7 Water Street Little Current, ON, P0P1K0", new LatLng(45.9810043,-81.926961)));
  26. }}));
  27. add(
  28. new College("Canadore",
  29. new ArrayList<Campus>(){{
  30. add(new Campus("College Drive", "100 College Drive North Bay, ON, P1B8K9", new LatLng(46.3436065,-79.49169369999998)));
  31. add(new Campus("Aviation Technology", "55 Aviation Avenue North Bay, ON, P1B8G2", new LatLng(46.3575357,-79.43371919999998)));
  32. add(new Campus("Commerce Court", "60 Commerce Crescent North Bay, ON, P1B8G4", new LatLng(46.31574089999999,-79.42817400000001)));
  33. add(new Campus("West Parry Sound", "1 College Drive Parry Sound, ON, P2A0A9", new LatLng(45.3616548,-80.03864440000001)));
  34. }}));
  35. add(
  36. new College("Centennial",
  37. new ArrayList<Campus>(){{
  38. add(new Campus("Progress", "941 Progress Avenue Toronto, ON, M1G3T8", new LatLng(43.7841775,-79.23172950000003)));
  39. add(new Campus("Ashtonbee", "75 Ashtonbee Road Toronto, ON, M1L4C9", new LatLng(43.7303548,-79.29160890000003)));
  40. add(new Campus("Downsview", "1 College Way Pembroke, ON, K8A0C8", new LatLng(45.826451,-77.12059999999997)));
  41. add(new Campus("Morningside", "755 Morningside Avenue Toronto, ON, M1C5J9", new LatLng(43.7863202,-79.19311920000001)));
  42. add(new Campus("Story Arts Centre", "951 Carlaw Avenue Toronto, ON, M4K3M2", new LatLng(43.6847261,-79.34884390000002)));
  43. add(new Campus("Eglinton Learning Site", "124 Eglinton Avenue West Toronto, ON, M4R2G8", new LatLng(43.706029,-79.40250989999998)));
  44. add(new Campus("Pickering Learning Site", "1340 Pickering Parkway Pickering, ON, L1V0C4", new LatLng(43.83303739999999,-79.08630629999999)));
  45. }}));
  46. add(
  47. new College("Conestoga",
  48. new ArrayList<Campus>(){{
  49. add(new Campus("Doon", "299 Doon Valley Drive Kitchener, ON, N2G4M4", new LatLng(43.3895953,-80.40396099999998)));
  50. add(new Campus("Brantford", "95 Darling Street Brantford, ON, N3T2K7", new LatLng(43.1402283,-80.26274710000001)));
  51. add(new Campus("Cambridge", "850 Fountain Street South Cambridge, ON, N3H0A8", new LatLng(43.3867525,-80.39683020000001)));
  52. add(new Campus("Guelph", "460 Speedvale Avenue West Guelph, ON, N1H0A8", new LatLng(43.5384107,-80.2938876)));
  53. add(new Campus("Ingersoll", "420 Thomas Street Ingersoll, ON, N5C3J7", new LatLng(43.0254098,-80.89705119999996)));
  54. add(new Campus("Waterloo", "108 University Avenue East Waterloo, ON, N2J2W2", new LatLng(43.4794371,-80.51857910000001)));
  55. }}));
  56. }};
  57. }
  58.  
  59. public class College implements Serializable {
  60.  
  61. String name;
  62. ArrayList<Campus> campuses;
  63.  
  64. public College(String name, ArrayList<Campus> campuses) {
  65. this.name = name;
  66. this.campuses = campuses;
  67. }
  68.  
  69. public String getName() {
  70. return name;
  71. }
  72.  
  73. public void setName(String name) {
  74. this.name = name;
  75. }
  76.  
  77. public ArrayList<Campus> getCampuses() {
  78. return campuses;
  79. }
  80.  
  81. public void setCampuses(ArrayList<Campus> campuses) {
  82. this.campuses = campuses;
  83. }
  84. }
  85.  
  86. public class Campus implements Serializable {
  87.  
  88. public Campus(String name, String address, LatLng location) {
  89. this.name = name;
  90. this.address = address;
  91. this.lat = location.latitude;
  92. this.lng = location.longitude;
  93. }
  94.  
  95. String name;
  96. String address;
  97. Double lat;
  98. Double lng;
  99.  
  100. public String getName() {
  101. return name;
  102. }
  103.  
  104. public void setName(String name) {
  105. this.name = name;
  106. }
  107.  
  108. public String getAddress() {
  109. return address;
  110. }
  111.  
  112. public void setAddress(String address) {
  113. this.address = address;
  114. }
  115.  
  116. public LatLng getLocation() {
  117. return new LatLng(this.lat, this.lng);
  118. }
  119.  
  120. public void setLocation(LatLng location) {
  121. this.lat = location.latitude;
  122. this.lng = location.longitude;
  123. }
  124. }
  125. }
Add Comment
Please, Sign In to add comment