bpp-seq  2.2.0
bpp::AlphabetState Class Reference

This is the base class to describe states in an Alphabet. More...

#include <Bpp/Seq/Alphabet/AlphabetState.h>

+ Inheritance diagram for bpp::AlphabetState:
+ Collaboration diagram for bpp::AlphabetState:

Public Member Functions

 AlphabetState (int num, const std::string &letter, const std::string &name)
 
virtual ~AlphabetState ()
 
int getNum () const
 Get the state's number. More...
 
void setNum (int num)
 Set the state's number. More...
 
const std::string & getLetter () const
 Get the letter(s) corresponding to the state. More...
 
void setLetter (const std::string &letter)
 Set the letter(s) of the state. More...
 
const std::string & getName () const
 Get the name of the state. More...
 
void setName (const std::string &name)
 Set the name of the state. More...
 
bool operator== (AlphabetState &l2)
 operator == More...
 
The Clonable interface.
AlphabetStateclone () const
 

Private Attributes

int num_
 
std::string letter_
 
std::string name_
 

Detailed Description

This is the base class to describe states in an Alphabet.

Author
Sylvain Gaillard

Definition at line 54 of file AlphabetState.h.

Constructor & Destructor Documentation

◆ AlphabetState()

bpp::AlphabetState::AlphabetState ( int  num,
const std::string &  letter,
const std::string &  name 
)
inline

Definition at line 61 of file AlphabetState.h.

Referenced by clone().

◆ ~AlphabetState()

virtual bpp::AlphabetState::~AlphabetState ( )
inlinevirtual

Definition at line 64 of file AlphabetState.h.

Member Function Documentation

◆ clone()

AlphabetState* bpp::AlphabetState::clone ( ) const
inline

Definition at line 76 of file AlphabetState.h.

References AlphabetState().

Referenced by bpp::CaseMaskedAlphabet::CaseMaskedAlphabet().

◆ getLetter()

const std::string& bpp::AlphabetState::getLetter ( ) const
inline

Get the letter(s) corresponding to the state.

The letter is a string because it may more than one char (for instance: codon).

Returns
The state's letter.

Definition at line 99 of file AlphabetState.h.

References letter_.

Referenced by bpp::CaseMaskedAlphabet::CaseMaskedAlphabet(), bpp::AbstractAlphabet::getCharCodeAt(), and bpp::AbstractAlphabet::updateMaps_().

◆ getName()

const std::string& bpp::AlphabetState::getName ( ) const
inline

Get the name of the state.

Returns
The full name of the state (i.e. Adenine).

Definition at line 112 of file AlphabetState.h.

References name_.

Referenced by bpp::CaseMaskedAlphabet::CaseMaskedAlphabet().

◆ getNum()

int bpp::AlphabetState::getNum ( ) const
inline

Get the state's number.

Returns
The state's number (i.e. -1 for gap (-)).

Definition at line 83 of file AlphabetState.h.

References num_.

Referenced by bpp::CaseMaskedAlphabet::CaseMaskedAlphabet(), bpp::AbstractAlphabet::getIntCodeAt(), bpp::NucleicAlphabet::getOverlap(), operator==(), bpp::NucleicAlphabet::subtract(), and bpp::AbstractAlphabet::updateMaps_().

◆ operator==()

bool bpp::AlphabetState::operator== ( AlphabetState l2)
inline

operator ==

Comparison is done on state num

Definition at line 125 of file AlphabetState.h.

References getNum().

◆ setLetter()

void bpp::AlphabetState::setLetter ( const std::string &  letter)
inline

Set the letter(s) of the state.

Parameters
letterThe state's letter.

Definition at line 105 of file AlphabetState.h.

References letter_.

◆ setName()

void bpp::AlphabetState::setName ( const std::string &  name)
inline

Set the name of the state.

Parameters
nameThe state's name

Definition at line 118 of file AlphabetState.h.

References name_.

◆ setNum()

void bpp::AlphabetState::setNum ( int  num)
inline

Set the state's number.

Parameters
numThe state's number.

Definition at line 89 of file AlphabetState.h.

References num_.

Member Data Documentation

◆ letter_

std::string bpp::AlphabetState::letter_
private

Definition at line 57 of file AlphabetState.h.

Referenced by getLetter(), and setLetter().

◆ name_

std::string bpp::AlphabetState::name_
private

Definition at line 58 of file AlphabetState.h.

Referenced by getName(), and setName().

◆ num_

int bpp::AlphabetState::num_
private

Definition at line 56 of file AlphabetState.h.

Referenced by getNum(), and setNum().


The documentation for this class was generated from the following file: