ARB
PRD_Range.cxx
Go to the documentation of this file.
1 #include "PRD_Range.hxx"
2 #include <iostream>
3 
4 using namespace std;
5 
6 //
7 // constructors
8 //
9 Range::Range (const PRD_Sequence_Pos value1_, const PRD_Sequence_Pos value2_) {
10  minimum = value1_;
11  maximum = value2_;
12 }
13 
15  minimum = 0;
16  maximum = 0;
17 }
18 
19 
20 //
21 // check if given value is in range
22 //
24  if ((value_ < minimum) || (value_ > maximum)) return false;
25 
26  return true;
27 }
28 
29 
30 //
31 // check if given range overlaps self
32 //
34  return includes(min_) || includes(max_);
35 }
36 
37 
38 //
39 // print range
40 //
41 void Range::print (const char *prefix_, const char *suffix_) {
42  cout << prefix_ << "(" << minimum << "," << maximum << ")" << suffix_;
43 }
Range()
Definition: PRD_Range.cxx:14
STL namespace.
void print(const char *prefix_, const char *suffix_)
Definition: PRD_Range.cxx:41
bool includes(PRD_Sequence_Pos value_)
Definition: PRD_Range.cxx:23
long int PRD_Sequence_Pos
Definition: PRD_Globals.hxx:21