18 vector<int> coded(list.size());
21 if (!getAlphabet()->isCharInAlphabet(i))
28 coded[j++] = getAlphabet()->charToInt(i);
42 if (!getAlphabet()->isIntInAlphabet(i))
54 if (pos >= content_.size())
59 c = getAlphabet()->intToChar(content_[pos]);
73 vector<int> coded(list.size());
76 if (!getAlphabet()->isCharInAlphabet(i))
77 throw BadCharException(i,
"EventDrivenIntSymbolList::setContent", getAlphabet());
83 coded[j++] = getAlphabet()->charToInt(i);
96 if (!getAlphabet()->isIntInAlphabet(i))
97 throw BadIntException(i,
"EventDrivenIntSymbolList::setContent", getAlphabet());
107 auto alphaPtr = getAlphabet();
136 if (pos >= content_.size())
141 c = getAlphabet()->intToChar(content_[pos]);
virtual void setContent(const std::vector< T > &list) override
Set the whole content of the list.
virtual void addElement(const T &c) override
Add a character to the end of the list.
virtual void setElement(size_t pos, const T &c) override
Set the element at position 'pos' to character 'c'.
virtual void setContent(const std::vector< T > &list) override
Set the whole content of the list.
An alphabet exception thrown when trying to specify a bad char to the alphabet.
An alphabet exception thrown when trying to specify a bad int to the alphabet.
virtual std::string toString() const override
Convert the list as a string.
virtual std::string getChar(size_t pos) const override
Get the element at position 'pos' as a character.
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
void addElement(const T &c) override
std::string getChar(size_t pos) const override
Get the element at position 'pos' as a character.
void setElement(size_t pos, const T &c) override
This alphabet is used to deal NumericAlphabet.