bpp-core3  3.0.0
AlphabetNumericState.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_ALPHABETNUMERICSTATE_H
6 #define BPP_SEQ_ALPHABET_ALPHABETNUMERICSTATE_H
7 
8 
9 // From the STL
10 #include <string>
11 
12 // From bpp-core
13 #include <Bpp/Clonable.h>
14 
15 // From bpp-seq
16 
17 #include "AlphabetState.h"
18 
19 namespace bpp
20 {
27 {
28 private:
29  double value_;
30 
31 public:
32  AlphabetNumericState(int num, double value, const std::string& letter, const std::string& name) : AlphabetState(num, letter, name), value_(value) {}
33 
34  // Class destructor
35  virtual ~AlphabetNumericState() {}
36 
37 public:
42  AlphabetNumericState* clone() const { return new AlphabetNumericState(*this); }
50  double getValue() const { return value_; }
51 
56  void setValue(double value) { value_ = value; }
57 };
58 }
59 #endif // BPP_SEQ_ALPHABET_ALPHABETNUMERICSTATE_H
This is the base class to describe states in an Alphabet.
Definition: AlphabetState.h:21
This alphabet is used to deal NumericAlphabet.
AlphabetNumericState * clone() const
AlphabetNumericState(int num, double value, const std::string &letter, const std::string &name)
void setValue(double value)
Set the state value.
States that do have a double value.
double getValue() const
Get the state value.