bpp-seq  2.2.0
bpp::AbstractSequenceContainer Class Referenceabstract

Partial implementation of the OrderedSequenceContainer interface. More...

#include <Bpp/Seq/Container/AbstractSequenceContainer.h>

+ Inheritance diagram for bpp::AbstractSequenceContainer:
+ Collaboration diagram for bpp::AbstractSequenceContainer:

Public Member Functions

 AbstractSequenceContainer (const Alphabet *alpha)
 This constructor initialize the alphabet pointer. More...
 
 AbstractSequenceContainer (const AbstractSequenceContainer &sc)
 
AbstractSequenceContaineroperator= (const AbstractSequenceContainer &sc)
 
 AbstractSequenceContainer (const SequenceContainer &sc)
 Copy constructor from any SequenceContainer object. More...
 
AbstractSequenceContaineroperator= (const SequenceContainer &sc)
 Assignation operator from any SequenceContainer object. More...
 
virtual ~AbstractSequenceContainer ()
 
virtual const SequencegetSequence (size_t sequenceIndex) const =0 throw (IndexOutOfBoundsException)
 Retrieve a sequence object from the container. More...
 
virtual void setSequence (size_t sequenceIndex, const Sequence &sequence, bool checkName)=0 throw (Exception)
 Replace a sequence in the container. More...
 
virtual SequenceremoveSequence (size_t sequenceIndex)=0 throw (IndexOutOfBoundsException, Exception)
 Extract (and remove) a sequence from the container. More...
 
virtual void deleteSequence (size_t sequenceIndex)=0 throw (IndexOutOfBoundsException, Exception)
 Delete a sequence of the container. More...
 
virtual size_t getSequencePosition (const std::string &name) const =0 throw (SequenceNotFoundException)
 Get the position of a sequence in sequence container from its name. More...
 
virtual bool hasSequence (const std::string &name) const =0
 Check if a sequence with a given name is present in the container. More...
 
virtual void addSequence (const Sequence &sequence, bool checkName)=0 throw (Exception)
 Add a sequence to the container. More...
 
virtual void clear ()=0
 Delete all sequences in the container. More...
 
virtual SequenceContainercreateEmptyContainer () const =0
 Return a copy of this container, but with no sequence inside. More...
 
From the SequenceContainer interface
const AlphabetgetAlphabet () const
 Get sequence container's alphabet. More...
 
const std::vector< int > & getContent (const std::string &name) const throw (SequenceNotFoundException)
 Get the content of a sequence. More...
 
std::string toString (const std::string &name) const throw (SequenceNotFoundException)
 Convert a particular sequence to a string. More...
 
const CommentsgetComments (const std::string &name) const throw (SequenceNotFoundException)
 Get comments of a particular sequence. More...
 
void setComments (const std::string &name, const Comments &comments) throw (SequenceNotFoundException)
 Set the comments of a particular sequence. More...
 
const CommentsgetGeneralComments () const
 Get the comments of this container. More...
 
void setGeneralComments (const Comments &comments)
 Set the comments of this container. More...
 
void deleteGeneralComments ()
 Delete the comments associated to this container. More...
 
From the OrderedSequenceContainer interface
virtual const std::string & getName (size_t sequenceIndex) const throw (IndexOutOfBoundsException)
 Get the name of a particular sequence. More...
 
virtual const std::vector< int > & getContent (size_t sequenceIndex) const throw (IndexOutOfBoundsException)
 Get the content of a sequence. More...
 
virtual std::string toString (size_t sequenceIndex) const throw (IndexOutOfBoundsException)
 Convert a particular sequence to a string. More...
 
virtual const CommentsgetComments (size_t sequenceIndex) const throw (IndexOutOfBoundsException)
 Get comments of a particular sequence. More...
 
virtual void setComments (size_t sequenceIndex, const Comments &comments)=0 throw (IndexOutOfBoundsException)
 Set the comments of a particular sequence. More...
 
SequenceContainer methods.
virtual const SequencegetSequence (const std::string &name) const =0 throw (SequenceNotFoundException)
 Retrieve a sequence object from the container. More...
 
virtual void setSequence (const std::string &name, const Sequence &sequence, bool checkName)=0 throw (Exception)
 Replace a sequence in the container. More...
 
virtual SequenceremoveSequence (const std::string &name)=0 throw (SequenceNotFoundException, Exception)
 Extract (and remove) a sequence from the container. More...
 
virtual void deleteSequence (const std::string &name)=0 throw (SequenceNotFoundException, Exception)
 Delete a sequence of the container. More...
 
virtual size_t getNumberOfSequences () const =0
 Get the number of sequences in the container. More...
 
virtual std::vector< std::string > getSequencesNames () const =0
 Get all the names of the sequences in the container. More...
 
virtual void setSequencesNames (const std::vector< std::string > &names, bool checkNames)=0 throw (Exception)
 Set all sequence names. More...
 
Provide direct access to sequences content.
Warning
These operators allow you to modifiy the content of the sequences. No checking is performed for your modifications, so use with care, or consider using the setContent() methods.
virtual int & valueAt (const std::string &sequenceName, size_t elementIndex)=0 throw (SequenceNotFoundException, IndexOutOfBoundsException)
 Element access function. More...
 
virtual const int & valueAt (const std::string &sequenceName, size_t elementIndex) const =0 throw (SequenceNotFoundException, IndexOutOfBoundsException)
 Element access function. More...
 
virtual int & valueAt (size_t sequenceIndex, size_t elementIndex)=0 throw (IndexOutOfBoundsException)
 Element access operator. More...
 
virtual const int & valueAt (size_t sequenceIndex, size_t elementIndex) const =0 throw (IndexOutOfBoundsException)
 Element access operator. More...
 
virtual int & operator() (size_t sequenceIndex, size_t elementIndex)=0
 Element access operator. More...
 
virtual const int & operator() (size_t sequenceIndex, size_t elementIndex) const =0
 Element access operator. More...
 
Provide direct access to sequences content.
Warning
These operators allow you to modifiy the content of the sequences. No checking is performed for your modifications, so use with care, or consider using the setContent() methods.
virtual int & operator() (const std::string &sequenceName, size_t elementIndex)=0
 Element access operator. More...
 
virtual const int & operator() (const std::string &sequenceName, size_t elementIndex) const =0
 Element access operator. More...
 

Private Attributes

const Alphabetalphabet_
 The container's alphabet. More...
 
Comments comments_
 The container's comments. More...
 

Detailed Description

Partial implementation of the OrderedSequenceContainer interface.

This abstract class provides an alphabet and comments, with associated methods.

Definition at line 57 of file AbstractSequenceContainer.h.

Constructor & Destructor Documentation

◆ AbstractSequenceContainer() [1/3]

bpp::AbstractSequenceContainer::AbstractSequenceContainer ( const Alphabet alpha)
inline

This constructor initialize the alphabet pointer.

This constructor is to be called by constructors of derived classes.

Parameters
alphaThe alphabet to be associated to this container.

Definition at line 81 of file AbstractSequenceContainer.h.

◆ AbstractSequenceContainer() [2/3]

bpp::AbstractSequenceContainer::AbstractSequenceContainer ( const AbstractSequenceContainer sc)
inline

Definition at line 84 of file AbstractSequenceContainer.h.

◆ AbstractSequenceContainer() [3/3]

bpp::AbstractSequenceContainer::AbstractSequenceContainer ( const SequenceContainer sc)
inline

Copy constructor from any SequenceContainer object.

Parameters
scAnother sequence container.

Definition at line 99 of file AbstractSequenceContainer.h.

◆ ~AbstractSequenceContainer()

virtual bpp::AbstractSequenceContainer::~AbstractSequenceContainer ( )
inlinevirtual

Definition at line 114 of file AbstractSequenceContainer.h.

Member Function Documentation

◆ addSequence()

virtual void bpp::SequenceContainer::addSequence ( const Sequence sequence,
bool  checkName 
)
throw (Exception
)
pure virtualinherited

Add a sequence to the container.

Parameters
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.
Exceptions
ExceptionAny other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation.

Implemented in bpp::VectorSequenceContainer, bpp::CompressedVectorSiteContainer, bpp::VectorSiteContainer, bpp::AlignedSequenceContainer, and bpp::MapSequenceContainer.

Referenced by bpp::SequenceContainerTools::append(), and bpp::NexusIOSequence::appendAlignmentFromStream().

◆ clear()

virtual void bpp::SequenceContainer::clear ( )
pure virtualinherited

◆ createEmptyContainer()

virtual SequenceContainer* bpp::SequenceContainer::createEmptyContainer ( ) const
pure virtualinherited

Return a copy of this container, but with no sequence inside.

This method creates a new SequenceContainer objet. The class of this container depends on the derivative class.

Returns
A new empty container, with the same alphabet as this one.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, bpp::MapSequenceContainer, and bpp::AlignedSequenceContainer.

◆ deleteGeneralComments()

void bpp::AbstractSequenceContainer::deleteGeneralComments ( )
inlinevirtual

Delete the comments associated to this container.

Implements bpp::SequenceContainer.

Definition at line 150 of file AbstractSequenceContainer.h.

References comments_.

◆ deleteSequence() [1/2]

virtual void bpp::OrderedSequenceContainer::deleteSequence ( size_t  sequenceIndex)
throw (IndexOutOfBoundsException,
Exception
)
pure virtualinherited

Delete a sequence of the container.

Parameters
sequenceIndexThe position of the sequence.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implemented in bpp::VectorSequenceContainer, bpp::MapSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::VectorSiteContainer.

Referenced by bpp::SequenceContainerTools::keepOnlySelectedSequences().

◆ deleteSequence() [2/2]

virtual void bpp::OrderedSequenceContainer::deleteSequence ( const std::string &  name)
throw (SequenceNotFoundException,
Exception
)
pure virtualinherited

Delete a sequence of the container.

Parameters
nameThe name of the sequence.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequenceContainer.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ getAlphabet()

const Alphabet* bpp::AbstractSequenceContainer::getAlphabet ( ) const
inlinevirtual

◆ getComments() [1/2]

const Comments& bpp::AbstractSequenceContainer::getComments ( const std::string &  name) const
throw (SequenceNotFoundException
)
inlinevirtual

Get comments of a particular sequence.

Parameters
nameThe name of the sequence.
Returns
The comments associated to sequence with name 'name'.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Definition at line 134 of file AbstractSequenceContainer.h.

References bpp::Sequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().

Referenced by bpp::CompressedVectorSiteContainer::CompressedVectorSiteContainer(), bpp::VectorSiteContainer::operator=(), bpp::CompressedVectorSiteContainer::operator=(), and bpp::VectorSiteContainer::VectorSiteContainer().

◆ getComments() [2/2]

virtual const Comments& bpp::AbstractSequenceContainer::getComments ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
inlinevirtual

Get comments of a particular sequence.

Parameters
sequenceIndexThe position of the sequence.
Returns
The comments associated to sequence at position 'sequenceIndex'.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Definition at line 177 of file AbstractSequenceContainer.h.

References bpp::Sequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().

◆ getContent() [1/2]

const std::vector<int>& bpp::AbstractSequenceContainer::getContent ( const std::string &  name) const
throw (SequenceNotFoundException
)
inlinevirtual

Get the content of a sequence.

Parameters
nameThe name of the sequence.
Returns
The content of the sequence as a vector of integers.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Definition at line 124 of file AbstractSequenceContainer.h.

References bpp::SymbolList::getContent(), and bpp::OrderedSequenceContainer::getSequence().

Referenced by bpp::SequenceContainerTools::getCodonPosition().

◆ getContent() [2/2]

virtual const std::vector<int>& bpp::AbstractSequenceContainer::getContent ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
inlinevirtual

Get the content of a sequence.

Parameters
sequenceIndexThe position of the sequence.
Returns
The content of the sequence as a vector of integers.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Definition at line 167 of file AbstractSequenceContainer.h.

References bpp::SymbolList::getContent(), and bpp::OrderedSequenceContainer::getSequence().

◆ getGeneralComments()

const Comments& bpp::AbstractSequenceContainer::getGeneralComments ( ) const
inlinevirtual

◆ getName()

virtual const std::string& bpp::AbstractSequenceContainer::getName ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
inlinevirtual

Get the name of a particular sequence.

Parameters
sequenceIndexThe position of the sequence.
Returns
The name of the sequence at position 'sequenceIndex'.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Definition at line 162 of file AbstractSequenceContainer.h.

References bpp::Sequence::getName(), and bpp::OrderedSequenceContainer::getSequence().

Referenced by bpp::VectorSequenceContainer::getSequencesNames(), and bpp::VectorSequenceContainer::hasSequence().

◆ getNumberOfSequences()

◆ getSequence() [1/2]

virtual const Sequence& bpp::OrderedSequenceContainer::getSequence ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
pure virtualinherited

◆ getSequence() [2/2]

virtual const Sequence& bpp::OrderedSequenceContainer::getSequence ( const std::string &  name) const
throw (SequenceNotFoundException
)
pure virtualinherited

Retrieve a sequence object from the container.

Parameters
nameThe name of the sequence.
Returns
A reference toward the Sequence with corresponding name.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequenceContainer.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ getSequencePosition()

virtual size_t bpp::OrderedSequenceContainer::getSequencePosition ( const std::string &  name) const
throw (SequenceNotFoundException
)
pure virtualinherited

Get the position of a sequence in sequence container from its name.

Parameters
nameThe name of the sequence.
Returns
The position of the sequence with name 'name', if it exists.
Exceptions
SequenceNotFoundExceptionIf no sequence with name 'name' could be found.

Implemented in bpp::VectorSequenceContainer, bpp::MapSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::VectorSiteContainer.

◆ getSequencesNames()

◆ hasSequence()

virtual bool bpp::SequenceContainer::hasSequence ( const std::string &  name) const
pure virtualinherited

Check if a sequence with a given name is present in the container.

Parameters
nameThe name of the sequence.
Returns
True if a sequence with the given name is present in the container.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [1/4]

virtual int& bpp::OrderedSequenceContainer::operator() ( size_t  sequenceIndex,
size_t  elementIndex 
)
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [2/4]

virtual const int& bpp::OrderedSequenceContainer::operator() ( size_t  sequenceIndex,
size_t  elementIndex 
) const
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [3/4]

virtual int& bpp::SequenceContainer::operator() ( const std::string &  sequenceName,
size_t  elementIndex 
)
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator()() [4/4]

virtual const int& bpp::SequenceContainer::operator() ( const std::string &  sequenceName,
size_t  elementIndex 
) const
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ operator=() [1/2]

◆ operator=() [2/2]

AbstractSequenceContainer& bpp::AbstractSequenceContainer::operator= ( const SequenceContainer sc)
inline

Assignation operator from any SequenceContainer object.

Parameters
scAnother sequence container.

Definition at line 107 of file AbstractSequenceContainer.h.

References alphabet_, comments_, bpp::SequenceContainer::getAlphabet(), and bpp::SequenceContainer::getGeneralComments().

◆ removeSequence() [1/2]

virtual Sequence* bpp::OrderedSequenceContainer::removeSequence ( size_t  sequenceIndex)
throw (IndexOutOfBoundsException,
Exception
)
pure virtualinherited

Extract (and remove) a sequence from the container.

Parameters
sequenceIndexThe position of the sequence.
Exceptions
IndexOutOfBoundsExceptionIf the name does not match any sequence in the container.

Implemented in bpp::VectorSequenceContainer, bpp::MapSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::VectorSiteContainer.

◆ removeSequence() [2/2]

virtual Sequence* bpp::OrderedSequenceContainer::removeSequence ( const std::string &  name)
throw (SequenceNotFoundException,
Exception
)
pure virtualinherited

Extract (and remove) a sequence from the container.

Parameters
nameThe name of the sequence.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequenceContainer.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::MapSequenceContainer, and bpp::VectorSiteContainer.

◆ setComments() [1/2]

void AbstractSequenceContainer::setComments ( const std::string &  name,
const Comments comments 
)
throw (SequenceNotFoundException
)
virtual

Set the comments of a particular sequence.

Parameters
nameThe name of the sequence.
commentsThe comments to set to sequence with name 'name'.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Reimplemented in bpp::VectorSequenceContainer.

Definition at line 48 of file AbstractSequenceContainer.cpp.

Referenced by bpp::VectorSequenceContainer::setComments().

◆ setComments() [2/2]

virtual void bpp::AbstractSequenceContainer::setComments ( size_t  sequenceIndex,
const Comments comments 
)
throw (IndexOutOfBoundsException
)
pure virtual

Set the comments of a particular sequence.

Parameters
sequenceIndexThe position of the sequence.
commentsThe comments to set to sequence with position 'i'.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Implemented in bpp::VectorSequenceContainer, bpp::MapSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::VectorSiteContainer.

◆ setGeneralComments()

void bpp::AbstractSequenceContainer::setGeneralComments ( const Comments comments)
inlinevirtual

◆ setSequence() [1/2]

virtual void bpp::OrderedSequenceContainer::setSequence ( size_t  sequenceIndex,
const Sequence sequence,
bool  checkName 
)
throw (Exception
)
pure virtualinherited

Replace a sequence in the container.

Parameters
sequenceIndexThe position of the sequence.
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.
ExceptionAny other kind of exception.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, bpp::MapSequenceContainer, and bpp::AlignedSequenceContainer.

◆ setSequence() [2/2]

virtual void bpp::OrderedSequenceContainer::setSequence ( const std::string &  name,
const Sequence sequence,
bool  checkName 
)
throw (Exception
)
pure virtualinherited

Replace a sequence in the container.

Parameters
nameThe name of the sequence.
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.
ExceptionAny other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation.

Implements bpp::SequenceContainer.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSiteContainer, bpp::AlignedSequenceContainer, bpp::MapSequenceContainer, and bpp::VectorSequenceContainer.

◆ setSequencesNames()

virtual void bpp::OrderedSequenceContainer::setSequencesNames ( const std::vector< std::string > &  names,
bool  checkNames 
)
throw (Exception
)
pure virtualinherited

Set all sequence names.

Parameters
namesA vector of strings with all sequence names. Its size must be strictly equal to the the size of the container (the number of sequences).
checkNamesTell if the container must check if the name of the sequence is already used in the container before adding it.
Exceptions
ExceptionIf there are redundant names in the input vector.

Implements bpp::SequenceContainer.

Implemented in bpp::MapSequenceContainer, bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, and bpp::VectorSiteContainer.

◆ toString() [1/2]

std::string bpp::AbstractSequenceContainer::toString ( const std::string &  name) const
throw (SequenceNotFoundException
)
inlinevirtual

Convert a particular sequence to a string.

Parameters
nameThe name of the sequence.
Returns
A string describing the content of the sequence.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Definition at line 129 of file AbstractSequenceContainer.h.

References bpp::OrderedSequenceContainer::getSequence(), and bpp::SymbolList::toString().

◆ toString() [2/2]

virtual std::string bpp::AbstractSequenceContainer::toString ( size_t  sequenceIndex) const
throw (IndexOutOfBoundsException
)
inlinevirtual

Convert a particular sequence to a string.

Parameters
sequenceIndexThe position of the sequence.
Returns
A string describing the content of the sequence.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implements bpp::OrderedSequenceContainer.

Definition at line 172 of file AbstractSequenceContainer.h.

References bpp::OrderedSequenceContainer::getSequence(), and bpp::SymbolList::toString().

◆ valueAt() [1/4]

virtual int& bpp::OrderedSequenceContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
)
throw (SequenceNotFoundException,
IndexOutOfBoundsException
)
pure virtualinherited

Element access function.

Allows direct access to the data stored in the container.

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.
Exceptions
SequenceNotFoundExceptionIf no corresponding sequence is found in the container.
IndexOutOfBoundsExceptionIf the element position is not valid.

Implements bpp::SequenceContainer.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ valueAt() [2/4]

virtual const int& bpp::OrderedSequenceContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
) const
throw (SequenceNotFoundException,
IndexOutOfBoundsException
)
pure virtualinherited

Element access function.

Allows direct access to the data stored in the container.

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.
Exceptions
SequenceNotFoundExceptionIf no corresponding sequence is found in the container.
IndexOutOfBoundsExceptionIf the element position is not valid.

Implements bpp::SequenceContainer.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ valueAt() [3/4]

virtual int& bpp::OrderedSequenceContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
)
throw (IndexOutOfBoundsException
)
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container.

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.
Exceptions
IndexOutOfBoundsExceptionIf a position is not valid.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

◆ valueAt() [4/4]

virtual const int& bpp::OrderedSequenceContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
) const
throw (IndexOutOfBoundsException
)
pure virtualinherited

Element access operator.

Allows direct access to the data stored in the container.

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.
Exceptions
IndexOutOfBoundsExceptionIf a position is not valid.

Implemented in bpp::CompressedVectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorSiteContainer, and bpp::MapSequenceContainer.

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::AbstractSequenceContainer::alphabet_
private

The container's alphabet.

Definition at line 65 of file AbstractSequenceContainer.h.

Referenced by getAlphabet(), and operator=().

◆ comments_

Comments bpp::AbstractSequenceContainer::comments_
private

The container's comments.

Definition at line 70 of file AbstractSequenceContainer.h.

Referenced by deleteGeneralComments(), getGeneralComments(), operator=(), and setGeneralComments().


The documentation for this class was generated from the following files: