5 #ifndef BPP_SEQ_INTSYMBOLLIST_H
6 #define BPP_SEQ_INTSYMBOLLIST_H
53 virtual void setContent(
const std::vector<std::string>& list) = 0;
76 virtual void addElement(
size_t pos,
const std::string& c) = 0;
84 virtual void setElement(
size_t pos,
const std::string& c) = 0;
91 virtual std::string
getChar(
size_t pos)
const = 0;
125 IntSymbolList(
const std::vector<std::string>& list, std::shared_ptr<const Alphabet> alpha) :
138 IntSymbolList(
const std::vector<int>& list, std::shared_ptr<const Alphabet> alpha) :
175 void setContent(
const std::vector<int>& list)
override;
177 void setContent(
const std::vector<std::string>& list)
override;
208 std::string
getChar(
size_t pos)
const override;
218 double operator()(
size_t siteIndex,
int state)
const override
271 const std::vector<std::string>& list,
272 std::shared_ptr<const Alphabet> alpha) :
289 const std::vector<int>& list,
290 std::shared_ptr<const Alphabet> alpha) :
350 virtual void setContent(
const std::vector<std::string>& list)
override;
352 void setContent(
const std::vector<int>& list)
override;
354 virtual std::string
toString()
const override;
358 virtual void addElement(
const std::string& c)
override;
360 virtual void addElement(
size_t pos,
const std::string& c)
override;
364 virtual void setElement(
size_t pos,
const std::string& c)
override;
366 virtual std::string
getChar(
size_t pos)
const override;
A partial implementation of a EventDrivenSymbolList object.
AbstractTemplateEventDrivenSymbolList< T > & operator=(const TemplateCoreSymbolListInterface< T > &list)
The generic assignment operator.
virtual const CoreSymbolListListener< int > & listener(size_t i) const override
virtual void addCoreSymbolListListener(std::shared_ptr< CoreSymbolListListener< int >> listener) override
A partial implementation of a SymbolList object.
void addElement(const T &c) override
Add a character to the end of the list.
void setElement(size_t pos, const T &c) override
Set the element at position 'pos' to character 'c'.
std::shared_ptr< const Alphabet > getAlphabet() const override
size_t size() const override
std::vector< int > content_
The list content.
AbstractTemplateSymbolList< T > & operator=(const TemplateCoreSymbolListInterface< T > &list)
The generic assignment operator.
A event-driven IntSymbolList object.
EventDrivenIntSymbolList(const IntSymbolList &list)
The generic copy constructor.
virtual void beforeSequenceInserted(const IntSymbolListInsertionEvent &event) override
virtual ~EventDrivenIntSymbolList()
EventDrivenIntSymbolList * clone() const override
virtual std::string toString() const override
Convert the list as a string.
virtual void afterSequenceSubstituted(const IntSymbolListSubstitutionEvent &event) override
virtual void beforeSequenceSubstituted(const IntSymbolListSubstitutionEvent &event) override
EventDrivenIntSymbolList(std::shared_ptr< const Alphabet > alpha)
Build a new void EventDrivenIntSymbolList object with the specified alphabet.
EventDrivenIntSymbolList(const std::vector< std::string > &list, std::shared_ptr< const Alphabet > alpha)
Build a new EventDrivenIntSymbolList object with the specified alphabet. The content of the site is i...
EventDrivenIntSymbolList(const EventDrivenIntSymbolList &list)
The copy constructor.
void addIntSymbolListListener(std::shared_ptr< IntSymbolListListener > listener)
virtual void beforeSequenceDeleted(const IntSymbolListDeletionEvent &event) override
EventDrivenIntSymbolList & operator=(const EventDrivenIntSymbolList &list)
The assignment operator.
virtual void afterSequenceInserted(const IntSymbolListInsertionEvent &event) override
EventDrivenIntSymbolList & operator=(const IntSymbolList &list)
The generic assignment operator.
virtual void afterSequenceDeleted(const IntSymbolListDeletionEvent &event) override
virtual void afterSequenceChanged(const IntSymbolListEditionEvent &event) override
EventDrivenIntSymbolList(const std::vector< int > &list, std::shared_ptr< const Alphabet > alpha)
Build a new EventDrivenIntSymbolList object with the specified alphabet. The content of the site is i...
virtual void beforeSequenceChanged(const IntSymbolListEditionEvent &event) override
virtual std::string getChar(size_t pos) const override
Get the element at position 'pos' as a character.
The specific IntSymbolList interface.
virtual std::string getChar(size_t pos) const =0
Get the element at position 'pos' as a character.
virtual void setElement(size_t pos, const std::string &c)=0
Set the element at position 'pos' to character 'c'.
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
virtual void addElement(size_t pos, const std::string &c)=0
Add a character at a certain position in the list.
virtual void addElement(const std::string &c)=0
Add a character to the end of the list.
virtual void setContent(const std::vector< std::string > &list)=0
Set the whole content of the list.
virtual ~IntSymbolListInterface()
A basic IntSymbolList object.
void addElement(const T &c) override
void setElement(size_t pos, const std::string &c) override
Set the element at position 'pos' to character 'c'.
void addElement(size_t pos, const std::string &c) override
Add a character at a certain position in the list.
double getStateValueAt(size_t siteIndex, int state) const override
get value of a state at a position
IntSymbolList & operator=(const IntSymbolListInterface &list)
The generic assignment operator.
IntSymbolList(std::shared_ptr< const Alphabet > alpha)
IntSymbolList * clone() const override
IntSymbolList & operator=(const IntSymbolList &list)
The assignment operator.
std::string getChar(size_t pos) const override
Get the element at position 'pos' as a character.
IntSymbolList(const std::vector< int > &list, std::shared_ptr< const Alphabet > alpha)
Build a new IntSymbolList object with the specified alphabet. The content of the site is initialized ...
void setElement(size_t pos, const T &c) override
std::string toString() const override
Convert the list as a string.
double operator()(size_t siteIndex, int state) const override
get value of a state at a position
void addElement(const std::string &c) override
Add a character to the end of the list.
IntSymbolList(const std::vector< std::string > &list, std::shared_ptr< const Alphabet > alpha)
Build a new IntSymbolList object with the specified alphabet. The content of the site is initialized ...
IntSymbolList(const IntSymbolList &list)
The copy constructor.
The CoreSymbolList interface.
virtual void addElement(const T &c)=0
Add a character to the end of the list.
virtual void setElement(size_t pos, const T &c)=0
Set the element at position 'pos' to character 'c'.
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
This alphabet is used to deal NumericAlphabet.
CoreSymbolListEditionEvent< int > IntSymbolListEditionEvent
CoreSymbolListListener< int > IntSymbolListListener
CoreSymbolListSubstitutionEvent< int > IntSymbolListSubstitutionEvent
CoreSymbolListInsertionEvent< int > IntSymbolListInsertionEvent
CoreSymbolListDeletionEvent< int > IntSymbolListDeletionEvent