Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.rodrigosilva.rodrigosilva_mapd711_assignment4;
- import com.google.android.gms.maps.model.LatLng;
- import java.io.Serializable;
- import java.util.ArrayList;
- import java.util.List;
- public class CollegeData implements Serializable {
- public ArrayList<College> getMockupData() {
- return new ArrayList<College>(){{
- add(
- new College("Algoquin",
- new ArrayList<Campus>(){{
- add(new Campus("Ottawa", "1385 Woodroffe Avenue Ottawa, ON, K2G1V8", new LatLng(45.3502599,-75.75587730000001)));
- add(new Campus("Perth", "7 Craig Street Perth, ON, K7H1X7", new LatLng(44.9029885,-76.23814800000002)));
- add(new Campus("Pembroke", "1 College Way Pembroke, ON, K8A0C8", new LatLng(45.826451,-77.12059999999997)));
- }}));
- add(
- new College("Cambrian",
- new ArrayList<Campus>(){{
- add(new Campus("Main", "1400 Barrydowne Road Sudbury, ON, P3A3V", new LatLng(46.5297834,-80.9411311)));
- add(new Campus("Espanola", "91 Tudhope Street, Suite 101 Espanola, ON, P5E1S6", new LatLng(46.2658076,-81.77107590000003)));
- add(new Campus("Manitoulin", "7 Water Street Little Current, ON, P0P1K0", new LatLng(45.9810043,-81.926961)));
- }}));
- add(
- new College("Canadore",
- new ArrayList<Campus>(){{
- add(new Campus("College Drive", "100 College Drive North Bay, ON, P1B8K9", new LatLng(46.3436065,-79.49169369999998)));
- add(new Campus("Aviation Technology", "55 Aviation Avenue North Bay, ON, P1B8G2", new LatLng(46.3575357,-79.43371919999998)));
- add(new Campus("Commerce Court", "60 Commerce Crescent North Bay, ON, P1B8G4", new LatLng(46.31574089999999,-79.42817400000001)));
- add(new Campus("West Parry Sound", "1 College Drive Parry Sound, ON, P2A0A9", new LatLng(45.3616548,-80.03864440000001)));
- }}));
- add(
- new College("Centennial",
- new ArrayList<Campus>(){{
- add(new Campus("Progress", "941 Progress Avenue Toronto, ON, M1G3T8", new LatLng(43.7841775,-79.23172950000003)));
- add(new Campus("Ashtonbee", "75 Ashtonbee Road Toronto, ON, M1L4C9", new LatLng(43.7303548,-79.29160890000003)));
- add(new Campus("Downsview", "1 College Way Pembroke, ON, K8A0C8", new LatLng(45.826451,-77.12059999999997)));
- add(new Campus("Morningside", "755 Morningside Avenue Toronto, ON, M1C5J9", new LatLng(43.7863202,-79.19311920000001)));
- add(new Campus("Story Arts Centre", "951 Carlaw Avenue Toronto, ON, M4K3M2", new LatLng(43.6847261,-79.34884390000002)));
- add(new Campus("Eglinton Learning Site", "124 Eglinton Avenue West Toronto, ON, M4R2G8", new LatLng(43.706029,-79.40250989999998)));
- add(new Campus("Pickering Learning Site", "1340 Pickering Parkway Pickering, ON, L1V0C4", new LatLng(43.83303739999999,-79.08630629999999)));
- }}));
- add(
- new College("Conestoga",
- new ArrayList<Campus>(){{
- add(new Campus("Doon", "299 Doon Valley Drive Kitchener, ON, N2G4M4", new LatLng(43.3895953,-80.40396099999998)));
- add(new Campus("Brantford", "95 Darling Street Brantford, ON, N3T2K7", new LatLng(43.1402283,-80.26274710000001)));
- add(new Campus("Cambridge", "850 Fountain Street South Cambridge, ON, N3H0A8", new LatLng(43.3867525,-80.39683020000001)));
- add(new Campus("Guelph", "460 Speedvale Avenue West Guelph, ON, N1H0A8", new LatLng(43.5384107,-80.2938876)));
- add(new Campus("Ingersoll", "420 Thomas Street Ingersoll, ON, N5C3J7", new LatLng(43.0254098,-80.89705119999996)));
- add(new Campus("Waterloo", "108 University Avenue East Waterloo, ON, N2J2W2", new LatLng(43.4794371,-80.51857910000001)));
- }}));
- }};
- }
- public class College implements Serializable {
- String name;
- ArrayList<Campus> campuses;
- public College(String name, ArrayList<Campus> campuses) {
- this.name = name;
- this.campuses = campuses;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public ArrayList<Campus> getCampuses() {
- return campuses;
- }
- public void setCampuses(ArrayList<Campus> campuses) {
- this.campuses = campuses;
- }
- }
- public class Campus implements Serializable {
- public Campus(String name, String address, LatLng location) {
- this.name = name;
- this.address = address;
- this.lat = location.latitude;
- this.lng = location.longitude;
- }
- String name;
- String address;
- Double lat;
- Double lng;
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getAddress() {
- return address;
- }
- public void setAddress(String address) {
- this.address = address;
- }
- public LatLng getLocation() {
- return new LatLng(this.lat, this.lng);
- }
- public void setLocation(LatLng location) {
- this.lat = location.latitude;
- this.lng = location.longitude;
- }
- }
- }
Add Comment
Please, Sign In to add comment