concordia-library/concordia/interval.cpp
rjawor e02bbaa0fa getTmMatches
Former-commit-id: 94aa3db2db88195c61c6ac70006c0e1d743dc854
2015-04-14 20:14:30 +02:00

21 lines
489 B
C++

#include "concordia/interval.hpp"
Interval::Interval(const SUFFIX_MARKER_TYPE start, const SUFFIX_MARKER_TYPE end):
_start(start),
_end(end) {
}
Interval::~Interval() {
}
bool Interval::intersects(Interval & interval) {
return !(_end - 1 < interval.getStart() ||
interval.getEnd() - 1 < _start);
}
SUFFIX_MARKER_TYPE Interval::getLength() {
return _end - _start;
}