2014-03-11 14:32:10 +01:00
|
|
|
#include "concordia/interval.hpp"
|
|
|
|
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
Interval::Interval(const SUFFIX_MARKER_TYPE start,
|
|
|
|
const SUFFIX_MARKER_TYPE end):
|
|
|
|
_start(start),
|
|
|
|
_end(end) {
|
2014-03-11 14:32:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Interval::~Interval() {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Interval::intersects(Interval & interval) {
|
2014-04-29 14:46:04 +02:00
|
|
|
return !(_end - 1 < interval.getStart() ||
|
|
|
|
interval.getEnd() - 1 < _start);
|
2014-03-11 14:32:10 +01:00
|
|
|
}
|
|
|
|
|
2015-04-14 20:14:30 +02:00
|
|
|
SUFFIX_MARKER_TYPE Interval::getLength() {
|
2014-03-11 14:32:10 +01:00
|
|
|
return _end - _start;
|
|
|
|
}
|
|
|
|
|