public class PopulationsFileReader extends DataFileReader
Modifier and Type | Field and Description |
---|---|
private StringBuilder |
createTableCommand |
private DatabaseImpl |
database |
private String |
dataFile |
private static String |
DATE_LC |
private static String |
DATE_OF_BIRTH |
private static String |
DATE_OF_DEATH |
private Collection<Integer> |
dateFields |
private String |
dateFormat |
private static String |
ID |
private Map<String,Integer> |
insertedColInfo |
private String |
insertString |
private static String |
LIFE_HISTORIES_TABLE_NAME |
private static String |
LOCATION |
private static String |
LOCATION_OF_BIRTH |
private static String |
LOCATION_OF_DEATH |
private static String |
POPULATION |
private DataFiles.PopulationFile |
populationFile |
private static String |
POPULATIONS_TABLE_NAME |
private static String |
SECTION_NAME |
private static String |
SPECIES |
private static String |
tableName |
Constructor and Description |
---|
PopulationsFileReader(DataFiles.PopulationFile populationFile,
DatabaseImpl dbImpl)
Create the populations file reader.
|
Modifier and Type | Method and Description |
---|---|
int |
insert()
Insert the data from the input file into the database.
|
private void |
readLifeHistory()
Read the life history declarations of a population file section in the configuration file, if there are errors,
they are noted and and exception is thrown with ALL the errors at the end of the method.
|
private void |
readPopulation()
Read the populations declarations of a population file section in the configuration file, if there are errors,
they are noted and and exception is thrown with ALL the errors at the end of the method.
|
asCsv, asQuestionCsv, createTable, insert, updateCreateTableCommand
private DatabaseImpl database
private String dataFile
private String dateFormat
private StringBuilder createTableCommand
private String insertString
private Collection<Integer> dateFields
private DataFiles.PopulationFile populationFile
private static String tableName
private static final String ID
private static final String LOCATION
private static final String POPULATION
private static final String DATE_LC
private static final String SPECIES
private static final String DATE_OF_BIRTH
private static final String LOCATION_OF_BIRTH
private static final String DATE_OF_DEATH
private static final String LOCATION_OF_DEATH
private static final String SECTION_NAME
private static final String POPULATIONS_TABLE_NAME
private static final String LIFE_HISTORIES_TABLE_NAME
public PopulationsFileReader(DataFiles.PopulationFile populationFile, DatabaseImpl dbImpl)
populationFile
- the [xml] tag of the config file that is to be read.dbImpl
- the implementation of the database object.private void readLifeHistory()
private void readPopulation()
public final int insert()
DataFileReader
insert
in class DataFileReader
Copyright © 2015 University of Glasgow. All rights reserved.