]> git.donarmstrong.com Git - mothur.git/blob - taxonomynode.cpp
fixes while testing 1.33.0
[mothur.git] / taxonomynode.cpp
1 /*
2  *  taxonomynode.cpp
3  *  
4  *
5  *  Created by Pat Schloss on 7/8/11.
6  *  Copyright 2011 Patrick D. Schloss. All rights reserved.
7  *
8  */
9
10 /**************************************************************************************************/
11
12 #include "taxonomynode.h"
13
14 /**************************************************************************************************/
15
16 TaxonomyNode::TaxonomyNode(string n, int l): name(n), level(l){
17     m = MothurOut::getInstance();
18         parent = -1;
19         numChildren = 0;
20         numSeqs = 0;
21 }
22
23 /**************************************************************************************************/
24
25 void TaxonomyNode::setName(string n)                    {       name = n;                                       }
26
27 /**************************************************************************************************/
28
29 string TaxonomyNode::getName()                                  {       return name;                            }
30
31 /**************************************************************************************************/
32
33 void TaxonomyNode::setParent(int p)                             {       parent = p;                                     }
34
35 /**************************************************************************************************/
36
37 int TaxonomyNode::getParent()                                   {       return parent;                          }
38
39 /**************************************************************************************************/
40
41 void TaxonomyNode::makeChild(string c, int i)   {       children[c] = i;                        }
42
43
44 /**************************************************************************************************/
45
46 map<string, int> TaxonomyNode::getChildren()    {       return children;                        }
47
48 /**************************************************************************************************/
49
50 int TaxonomyNode::getChildIndex(string c){
51         map<string, int>::iterator it = children.find(c);
52         if(it != children.end())        {       return it->second;                      }
53         else                                            {       return -1;                                      }       
54 }
55
56 /**************************************************************************************************/
57
58 int     TaxonomyNode::getNumKids()                                      {       return (int)children.size();            }
59
60 /**************************************************************************************************/
61
62 int     TaxonomyNode::getNumSeqs()                                      {       return numSeqs;                         }
63
64 /**************************************************************************************************/
65
66 void TaxonomyNode::setTotalSeqs(int n)                  {       totalSeqs = n;                          }
67
68 /**************************************************************************************************/
69
70 int TaxonomyNode::getLevel()                                    {       return level;                           }
71
72 /**************************************************************************************************/