diff --git a/src/A.java b/src/A.java new file mode 100644 index 0000000..4f7e82a --- /dev/null +++ b/src/A.java @@ -0,0 +1,14 @@ +public class A { + private C c; + private double value; + public A(C c) { + this.c = c; + } + public double getValue() { + return this.value; + } + public void updateGPS(double lat2, double long2) { + this.value = lat2; + this.c.updateLatitude(this.value); + } +} \ No newline at end of file diff --git a/src/B.java b/src/B.java new file mode 100644 index 0000000..30ec773 --- /dev/null +++ b/src/B.java @@ -0,0 +1,14 @@ +public class B { + private D d; + private double value; + public B(D d) { + this.d = d; + } + public double getValue() { + return this.value; + } + public void updateGPS(double lat2, double long2) { + this.value = long2; + this.d.updateLongitude(this.value); + } +} \ No newline at end of file diff --git a/src/C.java b/src/C.java new file mode 100644 index 0000000..4583623 --- /dev/null +++ b/src/C.java @@ -0,0 +1,9 @@ +public class C { + private double value; + public double getValue() { + return this.value; + } + public void updateLatitude(double latitude) { + this.value = latitude; + } +} \ No newline at end of file diff --git a/src/D.java b/src/D.java new file mode 100644 index 0000000..2f83e7e --- /dev/null +++ b/src/D.java @@ -0,0 +1,9 @@ +public class D { + private double value; + public double getValue() { + return this.value; + } + public void updateLongitude(double longitude) { + this.value = longitude; + } +} \ No newline at end of file diff --git a/src/Map.java b/src/Map.java index abfd465..f7017c1 100644 --- a/src/Map.java +++ b/src/Map.java @@ -1,30 +1,60 @@ -import java.util.*; - public class Map { - private MapLongitude mapLongitude; - private Longitude longitude; - private MapLatitude mapLatitude; - private Latitude latitude; + private D d; + private B b; + private C c; + private A a; public Map() { - this.mapLongitude = new MapLongitude(); - this.longitude = new Longitude(mapLongitude); - this.mapLatitude = new MapLatitude(); - this.latitude = new Latitude(mapLatitude); + this.d = new D(); + this.b = new B(d); + this.c = new C(); + this.a = new A(c); } public double getMapLongitude() { - return mapLongitude.getValue(); + return d.getValue(); } public double getLongitude() { - return longitude.getValue(); + return b.getValue(); } public void updateGPS(double lat2, double long2) { - this.longitude.updateGPS(lat2, long2); - this.latitude.updateGPS(lat2, long2); + this.b.updateGPS(lat2, long2); + this.a.updateGPS(lat2, long2); } public double getMapLatitude() { - return mapLatitude.getValue(); + return c.getValue(); } public double getLatitude() { - return latitude.getValue(); + return a.getValue(); } -} \ No newline at end of file +} + + +//import java.util.*; +// +//public class Map { +// private MapLongitude mapLongitude; +// private Longitude longitude; +// private MapLatitude mapLatitude; +// private Latitude latitude; +// public Map() { +// this.mapLongitude = new MapLongitude(); +// this.longitude = new Longitude(mapLongitude); +// this.mapLatitude = new MapLatitude(); +// this.latitude = new Latitude(mapLatitude); +// } +// public double getMapLongitude() { +// return mapLongitude.getValue(); +// } +// public double getLongitude() { +// return longitude.getValue(); +// } +// public void updateGPS(double lat2, double long2) { +// this.longitude.updateGPS(lat2, long2); +// this.latitude.updateGPS(lat2, long2); +// } +// public double getMapLatitude() { +// return mapLatitude.getValue(); +// } +// public double getLatitude() { +// return latitude.getValue(); +// } +//} \ No newline at end of file