00001 #include "Annotation.h" 00002 00003 using namespace model; 00004 00026 Annotation::Annotation(int id,int score) { 00027 m_iId = id; 00028 m_iScore = score; 00029 } 00030 00055 Annotation::Annotation(int id,int score, string name) { 00056 Annotation(id,score); 00057 m_sName = name; 00058 } 00059 00078 void Annotation::setId(int id) { 00079 m_iId = id; 00080 } 00081 00100 void Annotation::setScore(int score) { 00101 m_iScore = score; 00102 } 00103 00122 void Annotation::setName(string name) { 00123 m_sName = name; 00124 } 00125 00144 int Annotation::getId() { 00145 return m_iId; 00146 } 00147 00166 int Annotation::getScore() { 00167 return m_iScore; 00168 } 00169 00188 string Annotation::getName() { 00189 return m_sName; 00190 } 00191 00210 Annotation::Annotation(const Annotation& other) { 00211 m_iId = other.m_iId; 00212 m_iScore = other.m_iScore; 00213 m_sName = other.m_sName; 00214 } 00215 00237 Annotation& Annotation::operator=(const Annotation& other) 00238 { 00239 // if same object 00240 if ( this == &other ) 00241 return *this; 00242 00243 m_iId = other.m_iId; 00244 m_iScore = other.m_iScore; 00245 m_sName = other.m_sName; 00246 00247 return *this; 00248 } 00249 00271 bool Annotation::operator==( const Annotation& other ) const 00272 { 00273 00274 if( m_iId == other.m_iId 00275 && m_iScore == other.m_iScore 00276 && m_sName == other.m_sName ) { 00277 return true; 00278 } 00279 return false; 00280 } 00281 00303 bool Annotation::operator!=( const Annotation& other ) const 00304 { 00305 if( m_iId == other.m_iId 00306 && m_iScore == other.m_iScore 00307 && m_sName == other.m_sName ) { 00308 return false; 00309 } 00310 return true; 00311 }