Package microsim.data

Class ExportCSV

java.lang.Object
microsim.data.ExportCSV

public class ExportCSV extends 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 Long
     
    static String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExportCSV(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

    Modifier and Type
    Method
    Description
    void
    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

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • autoincrementSeed

      public static Long autoincrementSeed
    • directory

      public static String directory
  • Constructor Details

    • ExportCSV

      public ExportCSV(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 Details

    • 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.