3 #include "nameassignment.hpp"
5 //**********************************************************************************************************************
7 NameAssignment::NameAssignment(string nameMapFile){
9 openInputFile(nameMapFile, fileHandle);
13 //**********************************************************************************************************************
15 void NameAssignment::readMap(){
17 string firstCol, secondCol, skip;
21 // map<string, string> data;
25 fileHandle >> firstCol; //read from first column
26 fileHandle >> secondCol; //read from second column
28 // data[firstCol] = secondCol; //store data in map
30 list.push_back(secondCol); //adds data's value to list
31 (*this)[firstCol] = rowIndex++;
36 // map<string, string>::iterator it = data.begin();
37 // for(it;it!=data.end();it++){
38 // cout << it->first << endl;
39 // (*this)[it->first] = rowIndex;
44 cout << "Standard Error: " << e.what() << " has occurred in the NameAssignment class Function readMap. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
48 cout << "An unknown error has occurred in the NameAssignment class function readMap. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
53 //**********************************************************************************************************************
55 ListVector NameAssignment::getListVector(void){
61 //**********************************************************************************************************************
63 void NameAssignment::print(void){
65 map<string,int>::iterator it = (*this).begin();
66 for(it;it!=(*this).end();it++){
67 cout << it->first << '\t' << it->second << endl; //prints out keys and values of the map this.
71 cout << "Standard Error: " << e.what() << " has occurred in the NameAssignment class Function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
75 cout << "An unknown error has occurred in the NameAssignment class function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
80 //**********************************************************************************************************************
82 int NameAssignment::get(string key){
88 //**********************************************************************************************************************