Package edu.gsu.cs.dmlab.solgrind.fileio
Class CSVDataParser
- java.lang.Object
-
- edu.gsu.cs.dmlab.solgrind.fileio.DataParser
-
- edu.gsu.cs.dmlab.solgrind.fileio.CSVDataParser
-
public class CSVDataParser extends DataParser
This class parses the tracks for now.- Author:
- berkay - Nov 27, 2016
-
-
Field Summary
Fields Modifier and Type Field Description static String[]
COLUMN_NAMES
static au.com.bytecode.opencsv.CSVReader
csvReader
static String
FILE_NAME_EXTENSION
static int
MP_FIX_COUNT
static char
SEPERATOR
static String
timestampFormat
static String
TRAJECTORY_DATA_DIR_PATH
static org.locationtech.jts.io.WKTReader
wktReader
-
Constructor Summary
Constructors Constructor Description CSVDataParser()
CSVDataParser(String path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<String>
fileList(Path directory)
Set<Instance>
readInstances(EventType e)
Map<EventType,Collection<Instance>>
readToInstanceMap(Collection<EventType> eventTypes)
Read the instances in a given folder's CSV files to an instance map This is usually for data mining operations in solgrindMap<EventType,Set<Instance>>
readToInstanceMap(Collection<EventType> eventTypes, org.joda.time.Interval timeInterval)
This is the time filtered version of the read to instances map method above.static void
setDataDirectoryPath(String dir)
-
-
-
Field Detail
-
TRAJECTORY_DATA_DIR_PATH
public static String TRAJECTORY_DATA_DIR_PATH
-
COLUMN_NAMES
public static final String[] COLUMN_NAMES
-
timestampFormat
public static final String timestampFormat
- See Also:
- Constant Field Values
-
wktReader
public static final org.locationtech.jts.io.WKTReader wktReader
-
csvReader
public static au.com.bytecode.opencsv.CSVReader csvReader
-
SEPERATOR
public static final char SEPERATOR
- See Also:
- Constant Field Values
-
FILE_NAME_EXTENSION
public static final String FILE_NAME_EXTENSION
- See Also:
- Constant Field Values
-
MP_FIX_COUNT
public static int MP_FIX_COUNT
-
-
Constructor Detail
-
CSVDataParser
public CSVDataParser()
-
CSVDataParser
public CSVDataParser(String path)
-
-
Method Detail
-
setDataDirectoryPath
public static void setDataDirectoryPath(String dir)
-
readInstances
public Set<Instance> readInstances(EventType e)
- Specified by:
readInstances
in classDataParser
-
readToInstanceMap
public Map<EventType,Collection<Instance>> readToInstanceMap(Collection<EventType> eventTypes)
Read the instances in a given folder's CSV files to an instance map This is usually for data mining operations in solgrind- Parameters:
eventTypes
- arraylist of event types that will be used as file names too- Returns:
- instance map (EventType to a Colelction of Instances)
-
readToInstanceMap
public Map<EventType,Set<Instance>> readToInstanceMap(Collection<EventType> eventTypes, org.joda.time.Interval timeInterval)
This is the time filtered version of the read to instances map method above.- Parameters:
eventTypes
-timeInterval
-- Returns:
-
-