-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathStation.java
More file actions
36 lines (27 loc) · 813 Bytes
/
Copy pathStation.java
File metadata and controls
36 lines (27 loc) · 813 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
package subway.domain;
import java.util.*;
public class Station {
private String name;
private List<ConnectStationNode> connectStationNodes = new ArrayList<>();
private Station(String name) {
this.name = name;
}
public static Station create(String name){
return new Station(name);
}
public void addConnectStations(final ConnectStationNode connectStationNode){
connectStationNodes.add(connectStationNode);
}
public String getName() {
return name;
}
public boolean isEqualName(String name){
return name.equals(this.name);
}
public List<ConnectStationNode> getConnectStationNodes() {
return Collections.unmodifiableList(connectStationNodes);
}
public String toString(){
return name;
}
}