-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathPath.java
More file actions
32 lines (25 loc) · 881 Bytes
/
Copy pathPath.java
File metadata and controls
32 lines (25 loc) · 881 Bytes
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
package subway.domain;
import java.util.List;
public class Path {
private Line line;
private List<Station> stationList;
private PathDistanceWeight pathDistanceWeight;
private PathTimeWeight pathTimeWeight;
public Path(Line line, List<Station> stations, List<Integer> distances, List<Integer> times) {
this.line = line;
registerStation(stations);
this.pathDistanceWeight = new PathDistanceWeight(stations, distances);
this.pathTimeWeight = new PathTimeWeight(stations, times);
}
private void registerStation(List<Station> stations) {
for (Station station : stations) {
stationList.add(station);
}
}
public PathDistanceWeight getPathDistanceWeight() {
return pathDistanceWeight;
}
public PathTimeWeight getPathTimeWeight() {
return pathTimeWeight;
}
}