FiniteAlphabet Class Reference

Implements a finite size alphabet. More...

#include <Alphabet.h>

Inheritance diagram for FiniteAlphabet:

Alphabet List of all members.

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.

Detailed Description

Implements a finite size alphabet.

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.


Constructor & Destructor Documentation

FiniteAlphabet::FiniteAlphabet  )  [inline]
 

Default Constructor.

Definition at line 71 of file Alphabet.h.

FiniteAlphabet::FiniteAlphabet int  r  )  [inline]
 

Constructor.

Parameters:
r - the number of letters in the alphabet. Default names of letters are

Definition at line 77 of file Alphabet.h.

References theLetters.

FiniteAlphabet::FiniteAlphabet const vector< string > &  letters  )  [inline]
 

Constructor.

Parameters:
letters - the list of the letter names. The size of the alphabet is defined by the number of letters. If cannot match the letter, 0 is returned.

Definition at line 90 of file Alphabet.h.


Member Function Documentation

void FiniteAlphabet::addGenerator const string &  g  )  [inline, private]
 

Definition at line 142 of file Alphabet.h.

References theLetters.

string FiniteAlphabet::getLetter int  index  )  const [virtual]
 

Returns the name of the letter with a given index.

Parameters:
index - the index of a letter from the alphabet
Returns:
the name of the letter with index index

Implements Alphabet.

const vector<string>& FiniteAlphabet::getLetters  )  const
 

Returns the names of letters of the alphabet.

Returns:
the names of letters of the alphabet

Referenced by FPGroup::getGeneratorsNames().

int FiniteAlphabet::getNum const string &  letter  )  const [virtual]
 

Implements the conversion from a letter name into its corresponding index.

This is a temporary implemintation. Needs to be more efficient.

Parameters:
letter - the name of a letter
Returns:
letters index in the alphabet

Implements Alphabet.

int FiniteAlphabet::size  )  const [inline]
 

Return the size of the alphabet.

Definition at line 93 of file Alphabet.h.

References theLetters.


Friends And Related Function Documentation

friend class AlphabetFlexLexer [friend]
 

Definition at line 140 of file Alphabet.h.

ostream& operator<< ostream &  out,
const FiniteAlphabet a
[friend]
 

Output the alphabet into a stream.

Definition at line 117 of file Alphabet.h.

istream& operator>> istream &  in,
FiniteAlphabet a
[friend]
 

Read an alphabet from a string.

Definition at line 130 of file Alphabet.h.


Member Data Documentation

vector<string> FiniteAlphabet::theLetters [private]
 

Definition at line 143 of file Alphabet.h.

Referenced by addGenerator(), FiniteAlphabet(), and size().


The documentation for this class was generated from the following file:
Generated on Mon Feb 27 22:47:11 2006 for CRyptography And Groups (CRAG) by  doxygen 1.4.4