Package microsim.data

Class ExportCSV


  • public class ExportCSV
    extends java.lang.Object
    ExportCSV class allows the exporting of data to .csv files. This is a useful alternative to exporting to an output database, as it is faster and produces separate files for each class of object. Note that only numbers, enums or strings are exported to .csv files.
    Author:
    Ross Richardson
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.Long autoincrementSeed  
    • Constructor Summary

      Constructors 
      Constructor Description
      ExportCSV​(java.lang.Object target)
      Allows the exporting of all fields (including private and inherited fields) of an object to a .csv file named after the object's class name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dumpToCSV()
      Export data to the .csv files named after the class of the target object (or if a collection of objects, the class of the collection's members).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • autoincrementSeed

        public static java.lang.Long autoincrementSeed
    • Constructor Detail

      • ExportCSV

        public ExportCSV​(java.lang.Object target)
        Allows the exporting of all fields (including private and inherited fields) of an object to a .csv file named after the object's class name. Note that only numbers, enums or strings are exported to .csv files. The serialVersionUID of a class will also not be exported.
        Parameters:
        target - - the object whose fields will be exported to a .csv file with a name equal to the object's class name. If the target is a Collection of objects, each member of the collection will have their individual fields exported to the .csv file, labelled by their id.
    • Method Detail

      • dumpToCSV

        public void dumpToCSV()
        Export data to the .csv files named after the class of the target object (or if a collection of objects, the class of the collection's members). Note that only numbers, enums or strings are exported to .csv files.