bpp-seq3  3.0.0
bpp::AbstractSequencePositionIterator Class Referenceabstract

Partial implementation of the SequencePositionIterator interface. More...

#include <Bpp/Seq/SequencePositionIterators.h>

+ Inheritance diagram for bpp::AbstractSequencePositionIterator:
+ Collaboration diagram for bpp::AbstractSequencePositionIterator:

Public Member Functions

 AbstractSequencePositionIterator (const Sequence &seq, unsigned int pos=0)
 
 AbstractSequencePositionIterator (const AbstractSequencePositionIterator &aspi)
 
AbstractSequencePositionIteratoroperator= (const AbstractSequencePositionIterator &aspi)
 
virtual ~AbstractSequencePositionIterator ()
 
unsigned int getPosition () const
 Get the actual position of the iterator in the Sequence. More...
 
void setPosition (unsigned int pos)
 Set the position of the iterator. More...
 
int getValue () const
 Get the numerical value of the Sequence at current position. More...
 
std::string getChar () const
 Get the textual value of the Sequence at current position. More...
 
const SequencegetSequence () const
 Get the Sequence on which the iterator loops. More...
 
virtual SequencePositionIteratoroperator+= (int i)=0
 
virtual SequencePositionIteratoroperator-= (int i)=0
 
virtual SequencePositionIteratoroperator++ ()=0
 
virtual bool hasMorePositions () const =0
 Tells if there is more positions in the Sequence. More...
 
Comparison operators
bool operator== (const SequencePositionIterator &it) const
 
bool operator!= (const SequencePositionIterator &it) const
 

Private Attributes

const Sequencesequence_
 
unsigned int currentPosition_
 

Detailed Description

Partial implementation of the SequencePositionIterator interface.

Author
Sylvain Gaillard

Definition at line 71 of file SequencePositionIterators.h.

Constructor & Destructor Documentation

◆ AbstractSequencePositionIterator() [1/2]

bpp::AbstractSequencePositionIterator::AbstractSequencePositionIterator ( const Sequence seq,
unsigned int  pos = 0 
)
inline

Definition at line 79 of file SequencePositionIterators.h.

◆ AbstractSequencePositionIterator() [2/2]

bpp::AbstractSequencePositionIterator::AbstractSequencePositionIterator ( const AbstractSequencePositionIterator aspi)
inline

Definition at line 82 of file SequencePositionIterators.h.

◆ ~AbstractSequencePositionIterator()

virtual bpp::AbstractSequencePositionIterator::~AbstractSequencePositionIterator ( )
inlinevirtual

Definition at line 92 of file SequencePositionIterators.h.

Member Function Documentation

◆ getChar()

string AbstractSequencePositionIterator::getChar ( ) const
virtual

Get the textual value of the Sequence at current position.

Implements bpp::SequencePositionIterator.

Definition at line 54 of file SequencePositionIterators.cpp.

◆ getPosition()

unsigned int AbstractSequencePositionIterator::getPosition ( ) const
virtual

◆ getSequence()

const Sequence & AbstractSequencePositionIterator::getSequence ( ) const
virtual

Get the Sequence on which the iterator loops.

Returns
A reference toward the Sequence object.

Implements bpp::SequencePositionIterator.

Definition at line 33 of file SequencePositionIterators.cpp.

Referenced by bpp::SimpleSequencePositionIterator::hasMorePositions().

◆ getValue()

int AbstractSequencePositionIterator::getValue ( ) const
virtual

Get the numerical value of the Sequence at current position.

Implements bpp::SequencePositionIterator.

Definition at line 47 of file SequencePositionIterators.cpp.

◆ hasMorePositions()

virtual bool bpp::SequencePositionIterator::hasMorePositions ( ) const
pure virtualinherited

Tells if there is more positions in the Sequence.

Returns
true if there is more positions in the Sequence

Implemented in bpp::SimpleSequencePositionIterator.

◆ operator!=()

bool AbstractSequencePositionIterator::operator!= ( const SequencePositionIterator it) const
virtual

◆ operator++()

virtual SequencePositionIterator& bpp::SequencePositionIterator::operator++ ( )
pure virtualinherited

◆ operator+=()

virtual SequencePositionIterator& bpp::SequencePositionIterator::operator+= ( int  i)
pure virtualinherited

◆ operator-=()

virtual SequencePositionIterator& bpp::SequencePositionIterator::operator-= ( int  i)
pure virtualinherited

◆ operator=()

AbstractSequencePositionIterator& bpp::AbstractSequencePositionIterator::operator= ( const AbstractSequencePositionIterator aspi)
inline

Definition at line 85 of file SequencePositionIterators.h.

References currentPosition_, and sequence_.

◆ operator==()

bool AbstractSequencePositionIterator::operator== ( const SequencePositionIterator it) const
virtual

◆ setPosition()

void AbstractSequencePositionIterator::setPosition ( unsigned int  pos)
virtual

Set the position of the iterator.

Parameters
posThe position on the Sequence

Implements bpp::SequencePositionIterator.

Definition at line 26 of file SequencePositionIterators.cpp.

Referenced by bpp::SimpleSequencePositionIterator::operator++(), and bpp::SimpleSequencePositionIterator::operator+=().

Member Data Documentation

◆ currentPosition_

unsigned int bpp::AbstractSequencePositionIterator::currentPosition_
private

Definition at line 76 of file SequencePositionIterators.h.

Referenced by operator=().

◆ sequence_

const Sequence* bpp::AbstractSequencePositionIterator::sequence_
private

Definition at line 75 of file SequencePositionIterators.h.

Referenced by operator=().


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