23 auto alphaPtr = getAlphabet();
33 size_t seqSize = content_.size();
34 if (newSize == seqSize)
37 if (newSize < seqSize)
39 content_.resize(newSize);
44 int gap = getAlphabet()->getGapCharacterCode();
45 while (content_.size() < newSize)
46 content_.push_back(gap);
54 size_t seqSize = content_.size();
55 if (newSize == seqSize)
58 if (newSize < seqSize)
62 content_.erase(content_.begin(), content_.begin() +
static_cast<ptrdiff_t
>(seqSize - newSize));
67 int gap = getAlphabet()->getGapCharacterCode();
68 content_.insert(content_.begin(), newSize - seqSize, gap);
75 if (seq.
getAlphabet()->getAlphabetType() != getAlphabet()->getAlphabetType())
80 content_.push_back(i);
87 for (
auto i : content)
89 if (!getAlphabet()->isIntInAlphabet(i))
93 for (
auto i : content)
95 content_.push_back(i);
102 for (
auto i : content)
104 if (!getAlphabet()->isCharInAlphabet(i))
109 for (
auto i : content)
111 content_.push_back(getAlphabet()->charToInt(i));
117 auto alphaPtr = getAlphabet();
Exception thrown when two alphabets do not match.
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::shared_ptr< const Alphabet > getAlphabet() const =0
Get the alphabet associated to the list.
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
void setToSizeL(size_t newSize) override
Set up the size of a sequence from the left side.
void setToSizeR(size_t newSize) override
Set up the size of a sequence from the right side.
void append(const SequenceInterface &seq) override
Append the content of the sequence.
virtual const std::vector< T > & getContent() const =0
std::string removeWhiteSpaces(const std::string &s)
This alphabet is used to deal NumericAlphabet.