-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.java
55 lines (46 loc) · 1.4 KB
/
Node.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
// --== CS400 File Header Information ==--
// Name: Riya Kore
// Email: rykore@wisc.edu
// Team: EB
// TA: Sujitha
// Lecturer: Florian Heimrl
// Notes to Grader: None
/**
* This class implements the INode interface which helps you get the Start Location Node,
* the End Location Node, and the time required to reach the End Node from its shortest path.
*/
public class Node implements INode {
String startLocation;
String endLocation;
int travelTime;
public Node(String startLocation, String endLocation, int travelTime) {
this.startLocation = startLocation;
this.endLocation = endLocation;
this.travelTime = travelTime;
}
/**
* This method is used to get the name of the starting Node
* @return the name of the starting node
*/
@Override
public String getStartLocation() {
return this.startLocation;
}
/**
* This method is used to get the name of the Ending/ Destination Node
* @return the name of the ending node
*/
@Override
public String getEndLocation() {
return this.endLocation;
}
/**
* This method returns the travel time from the start Location to the end location
* taking its shortest path
* @return the amount of time required to reach the end location from the shortest path
*/
@Override
public int getTravelTime() {
return this.travelTime;
}
}