28 this->currentPosition_ = pos;
35 return *(this->sequence_);
42 return this->currentPosition_;
49 return this->sequence_->getValue(this->currentPosition_);
56 return this->sequence_->getChar(this->currentPosition_);
93 unsigned int d =
static_cast<unsigned int>(-i);
95 throw Exception(
"SimpleSequencePositionIterator::operator+=. Negative increment too large.");
106 return (*
this) += -i;
122 return (*
this) + (-i);
Partial implementation of the SequencePositionIterator interface.
bool operator==(const SequencePositionIterator &it) const
unsigned int getPosition() const
Get the actual position of the iterator in the Sequence.
bool operator!=(const SequencePositionIterator &it) const
int getValue() const
Get the numerical value of the Sequence at current position.
const Sequence & getSequence() const
Get the Sequence on which the iterator loops.
std::string getChar() const
Get the textual value of the Sequence at current position.
void setPosition(unsigned int pos)
Set the position of the iterator.
size_t size() const override
Get the number of elements in the list.
virtual unsigned int getPosition() const =0
Get the actual position of the iterator in the Sequence.
A basic implementation of the Sequence interface.
Loop over all positions in a Sequence.
SimpleSequencePositionIterator & operator++()
bool hasMorePositions() const
Tells if there is more positions in the Sequence.
SimpleSequencePositionIterator & operator+=(int i)
virtual SimpleSequencePositionIterator operator-(int i) const
SimpleSequencePositionIterator & operator-=(int i)
SimpleSequencePositionIterator(const Sequence &seq, unsigned int pos=0)
General constructor.
virtual SimpleSequencePositionIterator operator+(int i) const
This alphabet is used to deal NumericAlphabet.