concordia-library/concordia/interval.cpp
rjawor 655087582e anubis search stub
Former-commit-id: 41cf0c8811767219f6f58bc06d9729d724269e73
2014-03-11 14:32:10 +01:00

21 lines
468 B
C++

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