-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavSegment.java
62 lines (52 loc) · 1.1 KB
/
NavSegment.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
52
53
54
55
56
57
58
59
60
61
62
class NavSegment
{
static enum NAV_COMMAND { invalid, turn, proceed };
private NAV_COMMAND m_command; // turn left, turn right, proceed
private String m_streetName; // Westwood Blvd
private String m_direction; // "left" for turn or "northeast" for proceed
private double m_distance; // 3.2 //KM
private GeoSegment m_gs;
NavSegment()
{
m_command = NAV_COMMAND.invalid;
}
void initTurn(String turnDirection, String streetName)
{
m_command = NAV_COMMAND.turn;
m_streetName = streetName;
m_direction = turnDirection;
m_distance = 0;
}
void initProceed(String direction, String streetName, double distance, GeoSegment gs)
{
m_command = NAV_COMMAND.proceed;
m_direction = direction;
m_streetName = streetName;
m_distance = distance;
m_gs = gs;
}
NAV_COMMAND getCommandType()
{
return m_command;
}
String getDirection()
{
return m_direction;
}
String getStreet()
{
return m_streetName;
}
double getDistance()
{
return m_distance;
}
void setDistance(double dist)
{
m_distance = dist;
}
GeoSegment getSegment()
{
return m_gs;
}
};