bpp-seq  2.1.0
bpp::SymbolList Class Reference

The SymbolList interface. More...

#include <Bpp/Seq/SymbolList.h>

+ Inheritance diagram for bpp::SymbolList:
+ Collaboration diagram for bpp::SymbolList:

List of all members.

Public Member Functions

virtual ~SymbolList ()
virtual const AlphabetgetAlphabet () const =0
 Get the alphabet associated to the list.
virtual size_t size () const =0
 Get the number of elements in the list.
virtual std::string toString () const =0
 Convert the list as a string.
The Clonable interface
SymbolListclone () const =0
Acting on the content of the list.
virtual const std::vector< int > & getContent () const =0
 Get the whole content of the list as a vector of int.
virtual void setContent (const std::vector< int > &list)=0 throw (BadIntException)
 Set the whole content of the list.
virtual void setContent (const std::vector< std::string > &list)=0 throw (BadCharException)
 Set the whole content of the list.
Edition methods.
virtual void addElement (const std::string &c)=0 throw (BadCharException)
 Add a character to the end of the list.
virtual void addElement (size_t pos, const std::string &c)=0 throw (BadCharException, IndexOutOfBoundsException)
 Add a character at a certain position in the list.
virtual void setElement (size_t pos, const std::string &c)=0 throw (BadCharException, IndexOutOfBoundsException)
 Set the element at position 'pos' to character 'c'.
virtual void deleteElement (size_t pos)=0 throw (IndexOutOfBoundsException)
 Delete the element at position 'pos'.
virtual void deleteElements (size_t pos, size_t len)=0 throw (IndexOutOfBoundsException)
 Delete the elements at position 'pos'.
virtual std::string getChar (size_t pos) const =0 throw (IndexOutOfBoundsException)
 Get the element at position 'pos' as a character.
virtual void addElement (int v)=0 throw (BadIntException)
 Add a character to the end of the list.
virtual void addElement (size_t pos, int v)=0 throw (BadIntException, IndexOutOfBoundsException)
 Add a character at a certain position in the list.
virtual void setElement (size_t pos, int v)=0 throw (BadIntException, IndexOutOfBoundsException)
 Set the element at position 'pos' to character 'v'.
virtual int getValue (size_t pos) const =0 throw (IndexOutOfBoundsException)
 Get the element at position 'pos' as an int.
Provide direct access to the list content.
Warning:
These operators allow you to modifiy the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual const int & operator[] (size_t i) const =0
 Operator [] overloaded for quick access to a character in list.
virtual int & operator[] (size_t i)=0
 Operator [] overloaded for quick access to a character in list.
virtual void shuffle ()=0
 Randomly shuffle the content of the list, with linear complexity.

Detailed Description

The SymbolList interface.

See also:
Alphabet

Definition at line 60 of file SymbolList.h.


Constructor & Destructor Documentation

virtual bpp::SymbolList::~SymbolList ( ) [inline, virtual]

Definition at line 76 of file SymbolList.h.


Member Function Documentation

virtual void bpp::SymbolList::addElement ( const std::string &  c) throw (BadCharException) [pure virtual]

Add a character to the end of the list.

Parameters:
cThe character to add, given as a string.

Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.

Referenced by bpp::SequenceTools::getPutativeHaplotypes(), bpp::AbstractReverseTransliterator::reverse(), and bpp::AbstractTransliterator::translate().

virtual void bpp::SymbolList::addElement ( size_t  pos,
const std::string &  c 
) throw (BadCharException, IndexOutOfBoundsException) [pure virtual]

Add a character at a certain position in the list.

Parameters:
posThe postion where to insert the element.
cThe character to add, given as a string.

Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual void bpp::SymbolList::addElement ( int  v) throw (BadIntException) [pure virtual]

Add a character to the end of the list.

Parameters:
vThe character to add, given as an int.

Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual void bpp::SymbolList::addElement ( size_t  pos,
int  v 
) throw (BadIntException, IndexOutOfBoundsException) [pure virtual]

Add a character at a certain position in the list.

Parameters:
posThe postion where to insert the element.
vThe character to add, given as an int.

Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual void bpp::SymbolList::deleteElement ( size_t  pos) throw (IndexOutOfBoundsException) [pure virtual]

Delete the element at position 'pos'.

Parameters:
posThe position of the element to delete.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

Referenced by bpp::SequenceTools::getCDS(), bpp::SequenceTools::removeGaps(), and bpp::VectorSiteContainer::removeSequence().

virtual void bpp::SymbolList::deleteElements ( size_t  pos,
size_t  len 
) throw (IndexOutOfBoundsException) [pure virtual]

Delete the elements at position 'pos'.

Parameters:
posThe position of the first element to delete.
lenThe length of the region to delete.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual std::string bpp::SymbolList::getChar ( size_t  pos) const throw (IndexOutOfBoundsException) [pure virtual]

Get the element at position 'pos' as a character.

Parameters:
posThe position of the character to retrieve.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

Referenced by bpp::SiteContainerTools::resolveDottedAlignment().

virtual int bpp::SymbolList::getValue ( size_t  pos) const throw (IndexOutOfBoundsException) [pure virtual]

Get the element at position 'pos' as an int.

Parameters:
posThe position of the character to retrieve.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

Referenced by bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::invert(), and bpp::SequenceTools::invertComplement().

virtual const int& bpp::SymbolList::operator[] ( size_t  i) const [pure virtual]

Operator [] overloaded for quick access to a character in list.

Parameters:
iThe position to retrieve.
Returns:
The integer value of character at position i.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual int& bpp::SymbolList::operator[] ( size_t  i) [pure virtual]

Operator [] overloaded for quick access to a character in list.

Parameters:
iThe position to retrieve.
Returns:
The integer value of character at position i.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual void bpp::SymbolList::setContent ( const std::vector< int > &  list) throw (BadIntException) [pure virtual]

Set the whole content of the list.

Parameters:
listThe new content of the list.
See also:
The list constructor for information about the way lists are internaly stored.

Implemented in bpp::EdSymbolList, bpp::BasicSequence, bpp::BasicSymbolList, bpp::SequenceWithAnnotation, and bpp::Sequence.

virtual void bpp::SymbolList::setContent ( const std::vector< std::string > &  list) throw (BadCharException) [pure virtual]

Set the whole content of the list.

Parameters:
listThe new content of the list.
See also:
The list constructor for information about the way lists are internaly stored.

Implemented in bpp::EdSymbolList, bpp::BasicSequence, bpp::BasicSymbolList, bpp::SequenceWithAnnotation, and bpp::Sequence.

virtual void bpp::SymbolList::setElement ( size_t  pos,
const std::string &  c 
) throw (BadCharException, IndexOutOfBoundsException) [pure virtual]

Set the element at position 'pos' to character 'c'.

Parameters:
posThe position of the character to set.
cThe value of the element, given as a string.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

Referenced by bpp::SequenceTools::invert(), and bpp::SequenceTools::invertComplement().

virtual void bpp::SymbolList::setElement ( size_t  pos,
int  v 
) throw (BadIntException, IndexOutOfBoundsException) [pure virtual]

Set the element at position 'pos' to character 'v'.

Parameters:
posThe position of the character to set.
vThe value of the element, given as an int.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual void bpp::SymbolList::shuffle ( ) [pure virtual]

Randomly shuffle the content of the list, with linear complexity.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

virtual std::string bpp::SymbolList::toString ( ) const [pure virtual]

Convert the list as a string.

This method is useful for dumping a list to a file or to the screen for display.

Returns:
The whole list as a string.

Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.

Referenced by bpp::AbstractSequenceContainer::toString().


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