public class Lab3File extends Object
Constructor and Description |
---|
Lab3File() |
Modifier and Type | Method and Description |
---|---|
List<BLineTable> |
readLines(String fname)
Reads the bus line information from the given file returning a
List of BLineTable.
|
List<BStop> |
readStops(String fname)
Reads the bus stops in the given file into a List.
|
public List<BStop> readStops(String fname) throws MalformedData, IOException
Postcondition: All stop names are unique. (If a duplicate name is encountered, then an exception is thrown.)
fname
- the name of the file containing the bus stop dataMalformedData
IOException
BStop
public List<BLineTable> readLines(String fname) throws MalformedData, IOException
This method must be called after readStops
.
Postcondition: All stop names are known. (If an unknown name is encountered, then an exception is thrown.)
fname
- the name of the file containing the bus stop dataMalformedData
IOException
BLineTable
,
BLineStop