-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPoint.java
51 lines (40 loc) · 938 Bytes
/
Point.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package Lyft;
/**
* Represents a point as a longitude, latitude pair
* @author Ankit Patel
*
*/
public class Point{
private double latitude;
private double longitude;
private String name;
public Point(double latitude, double longitude, String name){
this.latitude = latitude;
this.longitude = longitude;
this.name = name;
}
public void setLongitude(double newLongitude){
this.longitude = newLongitude;
}
public void setLatitude(double newLatitude){
this.latitude = newLatitude;
}
public void setName(String newName){
this.name = newName;
}
public double getLongitude(){
return this.longitude;
}
public double getLatitude(){
return this.latitude;
}
public String getName(){
return this.name;
}
@Override
public String toString(){
StringBuffer sb = new StringBuffer();
sb.append(this.name + ": <" + this.latitude + "," + this.longitude + ">");
return sb.toString();
}
}