InfiniteAlphabet Class Reference

Implements an infinite size alphabet. More...

#include <Alphabet.h>

Inheritance diagram for InfiniteAlphabet:
Alphabet

List of all members.

Public Member Functions

 InfiniteAlphabet (string pref=string("x"))
 Constructor.
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.

Static Public Attributes

static InfiniteAlphabet defaultAlphabet
 Static instance of the default alphabet x_1, x_2, ...

Private Attributes

string thePrefix

Friends

ostream & operator<< (ostream &out, const InfiniteAlphabet &a)
 Output the alphabet into a stream.

Detailed Description

Implements an infinite size alphabet.

Definition at line 153 of file Alphabet.h.


Constructor & Destructor Documentation

InfiniteAlphabet::InfiniteAlphabet ( string  pref = string("x")  )  [inline]

Constructor.

Parameters:
pref - prefix to be used for letter names. By defalut the letter 'x' is used. In general letter names defined by appending the corresponding index to the prefix, i.e. <prefix><index>.

Definition at line 162 of file Alphabet.h.


Member Function Documentation

string InfiniteAlphabet::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.

int InfiniteAlphabet::getNum ( const string &  letter  )  const [virtual]

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

Parameters:
letter - the name of a letter
Returns:
letter index in the alphabet. If cannot match the letter, 0 is returned.

Implements Alphabet.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const InfiniteAlphabet a 
) [friend]

Output the alphabet into a stream.

Definition at line 183 of file Alphabet.h.


Member Data Documentation

Static instance of the default alphabet x_1, x_2, ...

Definition at line 180 of file Alphabet.h.

Referenced by Word::printOn().

string InfiniteAlphabet::thePrefix [private]

Definition at line 193 of file Alphabet.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Mon Sep 26 18:43:48 2011 for CRyptography And Groups (CRAG) by  doxygen 1.6.1