bpp-seq3  3.0.0
AlphabetState.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_SEQ_ALPHABET_ALPHABETSTATE_H
6 #define BPP_SEQ_ALPHABET_ALPHABETSTATE_H
7 
8 #include <Bpp/Clonable.h>
9 
10 
11 // From the STL
12 #include <string>
13 
14 namespace bpp
15 {
21 class AlphabetState : public virtual Clonable
22 {
23 private:
24  int num_;
25  std::string letter_;
26  std::string name_;
27 
28 public:
29  AlphabetState(int num, const std::string& letter, const std::string& name) : num_(num), letter_(letter), name_(name) {}
30 
31  // Class destructor
32  virtual ~AlphabetState() {}
33 
34 public:
39  AlphabetState* clone() const { return new AlphabetState(*this); }
47  int getNum() const { return num_; }
53  void setNum(int num) { num_ = num; }
54 
63  const std::string& getLetter() const { return letter_; }
69  void setLetter(const std::string& letter) { letter_ = letter; }
70 
76  const std::string& getName() const { return name_; }
82  void setName(const std::string& name) { name_ = name; }
83 
90  {
91  return getNum() == l2.getNum();
92  }
93 };
94 }
95 #endif // BPP_SEQ_ALPHABET_ALPHABETSTATE_H
This is the base class to describe states in an Alphabet.
Definition: AlphabetState.h:22
void setNum(int num)
Set the state's number.
Definition: AlphabetState.h:53
const std::string & getName() const
Get the name of the state.
Definition: AlphabetState.h:76
AlphabetState * clone() const
Definition: AlphabetState.h:39
const std::string & getLetter() const
Get the letter(s) corresponding to the state.
Definition: AlphabetState.h:63
int getNum() const
Get the state's number.
Definition: AlphabetState.h:47
void setName(const std::string &name)
Set the name of the state.
Definition: AlphabetState.h:82
virtual ~AlphabetState()
Definition: AlphabetState.h:32
AlphabetState(int num, const std::string &letter, const std::string &name)
Definition: AlphabetState.h:29
void setLetter(const std::string &letter)
Set the letter(s) of the state.
Definition: AlphabetState.h:69
bool operator==(AlphabetState &l2)
operator ==
Definition: AlphabetState.h:89
std::string letter_
Definition: AlphabetState.h:25
std::string name_
Definition: AlphabetState.h:26
This alphabet is used to deal NumericAlphabet.