Interval Class Reference

#include <Interval.h>

Inheritance diagram for Interval:

HalfAlignInterval IntervalChain IntervalPile HalfAlignPile

List of all members.

Public Member Functions

 Interval ()
 Interval (const int bb, const int ee)
 Interval (const Interval &iv)
 Interval (const string &str)
virtual ~Interval ()
int overlap (const Interval &i) const
int overlap (const int bb, const int ee) const
virtual int merge (Interval *i, const int cut=5)
virtual string toDelimitedString (const string &dl="\t") const
bool less (const Interval &iv) const
bool operator< (const Interval &iv) const
bool before (const Interval &iv) const
bool after (const Interval &iv) const
bool isNull () const
void setBegin (const int bb)
void setEnd (const int ee)
void set (const Interval &iv)
int getBegin () const
int begin () const
int getEnd () const
int end () const
virtual int size () const
int length () const

Private Attributes

int b
int e

Friends

ostream & operator<< (ostream &ous, const Interval &iv)


Detailed Description

this file use the composition design pattern the Interval class is a lot simpler than the Range class that considers all 4 possibility between two ranges when comparing them. In reality, most work is done with the ranges are int the + direction such as protein alignments. This class will make things simple and fast. b<e

[b, e] closed interval


Constructor & Destructor Documentation

Interval::Interval (  )  [inline]

Interval::Interval ( const int  bb,
const int  ee 
) [inline]

Interval::Interval ( const Interval iv  )  [inline]

Interval::Interval ( const string &  str  ) 

use string as input to construct a interval You can use a,b, a-b, a:b formats

References b, and e.

virtual Interval::~Interval (  )  [inline, virtual]


Member Function Documentation

int Interval::overlap ( const Interval i  )  const

References b, e, max, and min.

Referenced by merge().

int Interval::overlap ( const int  bb,
const int  ee 
) const

References b, e, max, and min.

int Interval::merge ( Interval i,
const int  cut = 5 
) [virtual]

Merging two Intervals. The merge only happens when the overlap > cut

Parameters:
cut the cutoff value for merging.
Returns:
the overlapping value regardless of the merging happened or not.
It is better to use the overlap method to control the merge method.

base class merge does not invalidate input pointer.

Reimplemented in IntervalPile.

References b, e, isNull(), max, min, and overlap().

Referenced by IntervalChain::add(), IntervalPile::add(), and IntervalPile::merge().

string Interval::toDelimitedString ( const string &  dl = "\t"  )  const [virtual]

Reimplemented in IntervalPile, and HalfAlignPile.

References b, and e.

Referenced by IntervalPile::toDelimitedString().

bool Interval::less ( const Interval iv  )  const [inline]

References b, and e.

Referenced by operator<().

bool Interval::operator< ( const Interval iv  )  const [inline]

References less().

bool Interval::before ( const Interval iv  )  const [inline]

References b, and e.

Referenced by IntervalChain::add().

bool Interval::after ( const Interval iv  )  const [inline]

References b, and e.

bool Interval::isNull (  )  const [inline]

References b, and e.

Referenced by merge().

void Interval::setBegin ( const int  bb  )  [inline]

References b.

Referenced by IntervalChain::add().

void Interval::setEnd ( const int  ee  )  [inline]

References e.

Referenced by IntervalChain::add().

void Interval::set ( const Interval iv  )  [inline]

References b, and e.

int Interval::getBegin (  )  const [inline]

return the beginning of the interval. begin() will do the same

References b.

Referenced by IntervalChain::add().

int Interval::begin (  )  const [inline]

returns the start of the interval

References b.

Referenced by longestORFPlus(), and P2Rindex().

int Interval::getEnd (  )  const [inline]

References e.

Referenced by IntervalChain::add().

int Interval::end (  )  const [inline]

References e.

Referenced by longestORFPlus(), and P2Rindex().

virtual int Interval::size (  )  const [inline, virtual]

moew meaningful for composite classes derived from this base class. Such as IntervalChain and IntervalPile

Returns:
the number of elements inside this element.

Reimplemented in IntervalPile, and IntervalChain.

int Interval::length (  )  const [inline]

return the length of the Interval For composite derived class, it is the Interval covered by all the members. it is min(b) - max(e) of all members.

References b, and e.

Referenced by HalfAlignPile::computeIntermediateResult(), and longestORFPlus().


Friends And Related Function Documentation

ostream& operator<< ( ostream &  ous,
const Interval iv 
) [friend]


Member Data Documentation

int Interval::b [private]

int Interval::e [private]


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

Generated on Wed Aug 10 11:57:11 2011 for Softwares from Orpara by  doxygen 1.5.6