-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathUnitPath.java
More file actions
45 lines (36 loc) · 945 Bytes
/
Copy pathUnitPath.java
File metadata and controls
45 lines (36 loc) · 945 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
33
34
35
36
37
38
39
40
41
42
43
44
45
package subway.domain;
import java.util.Set;
public class UnitPath {
private final Station start;
private final Station end;
//todo 아래 두 값 래핑
private final int time;
private final int distance;
public UnitPath(Station start, Station end, int time, int distance) {
this.start = start;
this.end = end;
this.time = time;
this.distance = distance;
}
public boolean isPathOf(Station start, Station end) {
if (this.start.equals(start) && this.end.equals(end)) {
return true;
}
if (this.start.equals(end) && this.end.equals(start)) {
return true;
}
return false;
}
public Station getEnd() {
return end;
}
public Station getStart() {
return start;
}
public int getDistance() {
return distance;
}
public int getTime() {
return time;
}
}