Package jmri.jmrit.timetable
Class TimeTableCsvExport
- java.lang.Object
-
- jmri.jmrit.timetable.TimeTableCsvExport
-
public class TimeTableCsvExport extends java.lang.Object
Export a timetable in CSV format for import into a speadsheet.CSV Content: Line 1 - Layout name, segment name and schedule name. Line 2 - Train names sorted by name and grouped by down or up direction. Line 3-n - Station row with the arrive and depart times for each train.
- Since:
- 4.15.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TimeTableCsvExport.TrainEntry
-
Field Summary
Fields Modifier and Type Field Description (package private) java.io.BufferedWriter
bufferedWriter
(package private) CSVPrinter
csvFile
(package private) java.util.List<TimeTableCsvExport.TrainEntry>
downTrains
(package private) boolean
errorOccurred
(package private) java.io.FileWriter
fileWriter
(package private) java.lang.String[]
stopRow
(package private) TimeTableDataManager
tdm
(package private) int
trainIndex
(package private) java.util.HashMap<java.lang.Integer,TimeTableCsvExport.TrainEntry>
trainMap
(package private) java.util.List<TimeTableCsvExport.TrainEntry>
upTrains
-
Constructor Summary
Constructors Constructor Description TimeTableCsvExport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exportCsv(java.io.File file, int layoutId, int segmentId, int scheduleId)
Create a CSV file that can be imported into a spreadsheet to create a timetable.(package private) java.lang.String
formatTime(int t)
-
-
-
Field Detail
-
errorOccurred
boolean errorOccurred
-
fileWriter
java.io.FileWriter fileWriter
-
bufferedWriter
java.io.BufferedWriter bufferedWriter
-
csvFile
CSVPrinter csvFile
-
trainMap
java.util.HashMap<java.lang.Integer,TimeTableCsvExport.TrainEntry> trainMap
-
trainIndex
int trainIndex
-
downTrains
java.util.List<TimeTableCsvExport.TrainEntry> downTrains
-
upTrains
java.util.List<TimeTableCsvExport.TrainEntry> upTrains
-
stopRow
java.lang.String[] stopRow
-
-
Constructor Detail
-
TimeTableCsvExport
public TimeTableCsvExport()
-
-
Method Detail
-
exportCsv
public boolean exportCsv(java.io.File file, int layoutId, int segmentId, int scheduleId) throws java.io.IOException
Create a CSV file that can be imported into a spreadsheet to create a timetable.- Parameters:
file
- The file to be created.layoutId
- The selected layout.segmentId
- The selected segment.scheduleId
- The selected schedule.- Returns:
- true if an error occured.
- Throws:
java.io.IOException
- if unable to export the CSV file.
-
formatTime
java.lang.String formatTime(int t)
-
-