#include <Alphabet.h>
Inheritance diagram for FiniteAlphabet:
Public Member Functions | |
FiniteAlphabet () | |
Default Constructor. | |
FiniteAlphabet (int r) | |
Constructor. | |
FiniteAlphabet (const vector< string > &letters) | |
Constructor. | |
int | size () const |
Return the size of the alphabet. | |
int | getNum (const string &letter) const |
Implements the conversion from a letter name into its corresponding index. | |
string | getLetter (int index) const |
Returns the name of the letter with a given index. | |
const vector< string > & | getLetters () const |
Returns the names of letters of the alphabet. | |
Private Member Functions | |
void | addGenerator (const string &g) |
Private Attributes | |
vector< string > | theLetters |
Friends | |
class | AlphabetFlexLexer |
ostream & | operator<< (ostream &out, const FiniteAlphabet &a) |
Output the alphabet into a stream. | |
istream & | operator>> (istream &in, FiniteAlphabet &a) |
Read an alphabet from a string. |
This is an implementation of a finite alphabet. Letter names are given as a parameter in the constructor
Definition at line 67 of file Alphabet.h.
|
Default Constructor.
Definition at line 71 of file Alphabet.h. |
|
Constructor.
Definition at line 77 of file Alphabet.h. References theLetters. |
|
Constructor.
Definition at line 90 of file Alphabet.h. |
|
Definition at line 142 of file Alphabet.h. References theLetters. |
|
Returns the name of the letter with a given index.
Implements Alphabet. |
|
Returns the names of letters of the alphabet.
Referenced by FPGroup::getGeneratorsNames(). |
|
Implements the conversion from a letter name into its corresponding index. This is a temporary implemintation. Needs to be more efficient.
Implements Alphabet. |
|
Return the size of the alphabet.
Definition at line 93 of file Alphabet.h. References theLetters. |
|
Definition at line 140 of file Alphabet.h. |
|
Output the alphabet into a stream.
Definition at line 117 of file Alphabet.h. |
|
Read an alphabet from a string.
Definition at line 130 of file Alphabet.h. |
|
Definition at line 143 of file Alphabet.h. Referenced by addGenerator(), FiniteAlphabet(), and size(). |