Refactor mark related classes.

- Mark is an abstract class which containing its name and type
- Single Mark is a sub class of Mark which containing only one GPS location
- Gate Mark is a sub class of Mark which containing two Single Marks

#refactor #fix #story[10] #story[11] #story[12]
This commit is contained in:
Haoming Yin
2017-03-17 15:21:04 +13:00
parent d6fe155d4d
commit 0b3ebf229f
11 changed files with 239 additions and 68 deletions
@@ -0,0 +1,45 @@
package seng302.models.mark;
/**
* Represents the marker as a single mark
*
* Created by Haoming Yin (hyi25) on 17/3/2017
*/
public class SingleMark extends Mark {
private double lat;
private double lon;
private String name;
/**
* Represents a marker
*
* @param name, the name of the marker*
* @param lat, the latitude of the marker
* @param lon, the longitude of the marker
*/
public SingleMark(String name, double lat, double lon) {
super(name, MarkType.SINGLE_MARK);
this.lat = lat;
this.lon = lon;
}
/**
* Represents the marker at the beginning of a leg
*
* @param name, the name of the marker
*/
public SingleMark(String name) {
super(name, MarkType.SINGLE_MARK);
this.lat = 0;
this.lon = 0;
}
public double getLatitude() {
return this.lat;
}
public double getLongitude() {
return this.lon;
}
}