File: integerAlphabet.h

package info (click to toggle)
fastml 3.11-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,772 kB
  • sloc: cpp: 48,522; perl: 3,588; ansic: 819; makefile: 386; python: 83; sh: 55
file content (29 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef ___INTEGER_ALPH
#define ___INTEGER_ALPH

#include "alphabet.h"
#include "errorMsg.h"


class integerAlphabet : public alphabet {
public:
	explicit integerAlphabet(int size): _size(size){}; 
	virtual ~integerAlphabet() {}
	virtual alphabet* clone() const { return new integerAlphabet(*this); }
	int unknown() const  {return -2;}
	int gap() const  {errorMsg::reportError("The method integerAlphabet::gap() is used"); return -1;} 
	int size() const {return _size;}
	int stringSize() const; // one letter code.
	int relations(const int charInSeq, const int charToCheck) const;
	int fromChar(const string& str, const int pos) const;
	int fromChar(const char s) const;
	string fromInt(const int in_id) const;
	vector<int> fromString(const string& str) const;
	bool isSpecific(const int id) const {return true;}

private:
	int _size;

};

#endif