src/main/java/com/billybyte/csvprocessing/iceexpiryprocessing/IceExpiryDatabaseBuild.java
protected static NeoDatisSingleClassDataBase<String, IceExpiryData> populateDatabase(List<String[]> csvData, 
			String databaseOutputPath,Pattern exchangeSymbolRegexValidator){
		// open the database (or create it)
		NeoDatisSingleClassDataBase<String, IceExpiryData> dataBase = 
			new NeoDatisSingleClassDataBase<String, IceExpiryData>(databaseOutputPath,IceExpiryData.class);
		
		// start from index = 1 to avoid header
		for(int i = 1;i<csvData.size();i++){
			// get a line
			String[] line = csvData.get(i);
			if(line[0].contains("12/12/2011")){
				Utils.prtObErrMess(IceExpiryDatabaseBuild.class, " debuggin line reached to fine 12/05/2011");
			}
			// validate it and get exchange
			String exchString =  getExchangeStringFromRegex(line);
			if(exchString==null)continue;
			
			// translate that into a SecExchange enum object
			SecExchange  exch = SecExchange.fromString(exchangeInCsvToExchangeMap.get(exchString));

			// get hash map with basic symbol info (does not help database build, but allows you
			//  to print useful info at end of main.
			HashMap<String,String> thisExchangeInfoHashMap = getExchangeSymbolMapHashMap(exch);
			
			// update database with all symbols that are referenced on this csv line
			updateHashMaps(line,  exch,   thisExchangeInfoHashMap, exchangeSymbolRegexValidator);
			
			// print the csv line that you just processed
			Utils.prtObMess(IceExpiryDatabaseBuild.class, Arrays.toString(line));
			
		}
		
		// now update database
		Utils.prtObMess(IceExpiryDatabaseBuild.class, " updating database ...");
		for(String key:iceExpiryDataMap.keySet()){
			IceExpiryData ied = dataBase.get("shortName", key);
			if(ied==null){
				// update it
				dataBase.put(iceExpiryDataMap.get(key));
			}
		}
		// save the database by closing it
		dataBase.close();
		dataBase.open();
		return dataBase;

		
	}
/**
	 * This is the main loop, which reads every csv line, parses it, and creates of database of IceExpiryData objects
	 * @param csvData - data from ICE
	 * @param databaseOutputPath - path of database
	 * @return - database, populated
	 */
This is the main loop, which reads every csv line, parses it, and creates of database of IceExpiryData objects
@param csvData - data from ICE
@param databaseOutputPath - path of database
@return - database, populated
This is the main loop which reads every csv line parses it and creates of database of IceExpiryData objects @param csvData - data from ICE @param databaseOutputPath - path of database @return - database populated
protected static NeoDatisSingleClassDataBase<String, IceExpiryData> populateDatabase(List<String[]> csvData, 
			String databaseOutputPath,Pattern exchangeSymbolRegexValidator){
		NeoDatisSingleClassDataBase<String, IceExpiryData> dataBase = 
			new NeoDatisSingleClassDataBase<String, IceExpiryData>(databaseOutputPath,IceExpiryData.class);
		for(int i = 1;i<csvData.size();i++){
			String[] line = csvData.get(i);
			if(line[0].contains("12/12/2011")){
				Utils.prtObErrMess(IceExpiryDatabaseBuild.class, " debuggin line reached to fine 12/05/2011");
			}
			String exchString =  getExchangeStringFromRegex(line);
			if(exchString==null)continue;
			SecExchange  exch = SecExchange.fromString(exchangeInCsvToExchangeMap.get(exchString));
			HashMap<String,String> thisExchangeInfoHashMap = getExchangeSymbolMapHashMap(exch);
			updateHashMaps(line,  exch,   thisExchangeInfoHashMap, exchangeSymbolRegexValidator);
			Utils.prtObMess(IceExpiryDatabaseBuild.class, Arrays.toString(line));
		}
		Utils.prtObMess(IceExpiryDatabaseBuild.class, " updating database ...");
		for(String key:iceExpiryDataMap.keySet()){
			IceExpiryData ied = dataBase.get("shortName", key);
			if(ied==null){
				dataBase.put(iceExpiryDataMap.get(key));
			}
		}
		dataBase.close();
		dataBase.open();
		return dataBase;
	}
protected static NeoDatisSingleClassDataBase < String , IceExpiryData > populateDatabase ( List < String [ ] > csvData , String databaseOutputPath , Pattern exchangeSymbolRegexValidator ) { NeoDatisSingleClassDataBase < String , IceExpiryData > dataBase = new NeoDatisSingleClassDataBase < String , IceExpiryData > ( databaseOutputPath , IceExpiryData . class ) ; for ( int i = 1 ; i < csvData . size ( ) ; i ++ ) { String [ ] line = csvData . get ( i ) ; if ( line [ 0 ] . contains ( "12/12/2011" ) ) { Utils . prtObErrMess ( IceExpiryDatabaseBuild . class , " debuggin line reached to fine 12/05/2011" ) ; } String exchString = getExchangeStringFromRegex ( line ) ; if ( exchString == null ) continue ; SecExchange exch = SecExchange . fromString ( exchangeInCsvToExchangeMap . get ( exchString ) ) ; HashMap < String , String > thisExchangeInfoHashMap = getExchangeSymbolMapHashMap ( exch ) ; updateHashMaps ( line , exch , thisExchangeInfoHashMap , exchangeSymbolRegexValidator ) ; Utils . prtObMess ( IceExpiryDatabaseBuild . class , Arrays . toString ( line ) ) ; } Utils . prtObMess ( IceExpiryDatabaseBuild . class , " updating database ..." ) ; for ( String key : iceExpiryDataMap . keySet ( ) ) { IceExpiryData ied = dataBase . get ( "shortName" , key ) ; if ( ied == null ) { dataBase . put ( iceExpiryDataMap . get ( key ) ) ; } } dataBase . close ( ) ; dataBase . open ( ) ; return dataBase ; }
This is the main loop, which reads every csv line, parses it, and creates of database of IceExpiryData objects
 @param csvData - data from ICE
 @param databaseOutputPath - path of database
 @return - database, populated
This is the main loop which reads every csv line parses it and creates of database of IceExpiryData objects @param csvData - data from ICE @param databaseOutputPath - path of database @return - database populated
// open the database (or create it)
 // start from index = 1 to avoid header
 // get a line
 // validate it and get exchange
 // translate that into a SecExchange enum object
 // get hash map with basic symbol info (does not help database build, but allows you
 //  to print useful info at end of main.
 // update database with all symbols that are referenced on this csv line
 // print the csv line that you just processed
 // now update database
 // update it
 // save the database by closing it
