Class Network
java.lang.Object
com.sanderjurgens.metroplanner.model.Network
An overall network that contains and regulates all lines and stations. It
also reads and imports a network from a file.
- Author:
- sanderjurgens
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the line with the given code.Returns the set of all lines.getName()
Returns the name of the network.getStation
(String code) Returns the station with the given code.Returns the set of all stations.toString()
Returns a textual representation of this network.
-
Constructor Details
-
Network
Constructs a network based on a file- Parameters:
url
- the URL of the resource containing the network- Throws:
IOException
- if an error occurs while reading the file
-
-
Method Details
-
getName
Returns the name of the network.- Returns:
- the name of the network
-
getStationSet
Returns the set of all stations.- Returns:
- the set of all stations
-
getLineSet
Returns the set of all lines.- Returns:
- the set of all lines
-
getStation
Returns the station with the given code.- Parameters:
code
- a given code- Returns:
- the station with the given code
-
getLine
Returns the line with the given code.- Parameters:
code
- a given code- Returns:
- the line with the given code
-
toString
Returns a textual representation of this network.
-