bpp-core3  3.0.0
bpp::RangeCollection< T > Class Template Referenceabstract

Interface discribing a collection of Range objects. More...

#include <Bpp/Numeric/Range.h>

+ Inheritance diagram for bpp::RangeCollection< T >:

Public Member Functions

virtual ~RangeCollection ()
 
virtual void addRange (const Range< T > &r)=0
 Add a new range to the collection. More...
 
virtual void restrictTo (const Range< T > &r)=0
 Get the intersection with a given range. More...
 
virtual void filterWithin (const Range< T > &r)=0
 Only keep the ranges that fall within the given range. More...
 
virtual std::string toString () const =0
 
virtual bool isEmpty () const =0
 
virtual size_t size () const =0
 
virtual size_t totalLength () const =0
 
virtual const Range< T > & getRange (size_t i) const =0
 
virtual void clear ()=0
 Clear the collection. More...
 

Detailed Description

template<class T>
class bpp::RangeCollection< T >

Interface discribing a collection of Range objects.

Definition at line 185 of file Range.h.

Constructor & Destructor Documentation

◆ ~RangeCollection()

template<class T >
virtual bpp::RangeCollection< T >::~RangeCollection ( )
inlinevirtual

Definition at line 188 of file Range.h.

References bpp::Range< T >::isEmpty(), and bpp::Range< T >::toString().

Member Function Documentation

◆ addRange()

template<class T >
virtual void bpp::RangeCollection< T >::addRange ( const Range< T > &  r)
pure virtual

Add a new range to the collection.

Parameters
rThe range to add to the collection.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ clear()

template<class T >
virtual void bpp::RangeCollection< T >::clear ( )
pure virtual

Clear the collection.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ filterWithin()

template<class T >
virtual void bpp::RangeCollection< T >::filterWithin ( const Range< T > &  r)
pure virtual

Only keep the ranges that fall within the given range.

Parameters
rRestriction range.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ getRange()

template<class T >
virtual const Range<T>& bpp::RangeCollection< T >::getRange ( size_t  i) const
pure virtual
Returns
The ith range in the collection.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ isEmpty()

template<class T >
virtual bool bpp::RangeCollection< T >::isEmpty ( ) const
pure virtual
Returns
True if the set does not contain any range.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ restrictTo()

template<class T >
virtual void bpp::RangeCollection< T >::restrictTo ( const Range< T > &  r)
pure virtual

Get the intersection with a given range.

The new multirange is the union of all ranges intersections with the given range.

Parameters
rRestriction range.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ size()

template<class T >
virtual size_t bpp::RangeCollection< T >::size ( ) const
pure virtual
Returns
The number of ranges in the collection.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ toString()

template<class T >
virtual std::string bpp::RangeCollection< T >::toString ( ) const
pure virtual
Returns
A string representation of the set of intervals.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.

◆ totalLength()

template<class T >
virtual size_t bpp::RangeCollection< T >::totalLength ( ) const
pure virtual
Returns
The number of positions in the collection.

Implemented in bpp::MultiRange< T >, and bpp::RangeSet< T >.


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