Class CSVManager
java.lang.Object
real_time_traffic_simulation_with_java.tools.CSVManager
Manages CSV log files for the traffic simulation.
It creates a new CSV file with a timestamped name upon instantiation (format: YYYY-MM-DD HH_MM_SS).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseCSV()Closes the CSV writer to release file resources.Getter to retrieve the file path of the CSV logGetter to retrieve the timestamp used in the CSV file namevoidAppends new rows of data to the CSV file.
-
Constructor Details
-
CSVManager
public CSVManager()Manages CSV log files for the traffic simulation. It creates a new CSV file with a timestamped name upon instantiation (format: YYYY-MM-DD HH_MM_SS).
-
-
Method Details
-
getFilePath
Getter to retrieve the file path of the CSV log -
getTimeStamp
Getter to retrieve the timestamp used in the CSV file name -
updateCSV
Appends new rows of data to the CSV file.- Parameters:
data- A list of string arrays representing the data rows to be added.- Throws:
IllegalArgumentException- if the length of any data row does not match the number of headers.
-
closeCSV
public void closeCSV()Closes the CSV writer to release file resources. Currently Beta testing
-