2015-04-17 14:17:59 +02:00
|
|
|
#ifndef MATCHED_PATTERN_FRAGMENT_HDR
|
|
|
|
#define MATCHED_PATTERN_FRAGMENT_HDR
|
|
|
|
|
|
|
|
#include "concordia/common/config.hpp"
|
2015-04-21 15:14:48 +02:00
|
|
|
#include "concordia/interval.hpp"
|
2015-04-17 14:17:59 +02:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Class representing matched pattern fragment in concordia search.
|
2015-04-21 15:14:48 +02:00
|
|
|
This fragment can be seen as an interval of the pattern.
|
2015-04-17 14:17:59 +02:00
|
|
|
*/
|
|
|
|
|
2015-04-21 15:14:48 +02:00
|
|
|
class MatchedPatternFragment : public Interval {
|
2015-04-17 14:17:59 +02:00
|
|
|
public:
|
|
|
|
MatchedPatternFragment(const SUFFIX_MARKER_TYPE & exampleId,
|
|
|
|
const SUFFIX_MARKER_TYPE & exampleOffset,
|
|
|
|
const SUFFIX_MARKER_TYPE & patternOffset,
|
|
|
|
const SUFFIX_MARKER_TYPE & matchedLength);
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~MatchedPatternFragment();
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE getExampleId() const {
|
|
|
|
return _exampleId;
|
|
|
|
}
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE getExampleOffset() const {
|
|
|
|
return _exampleOffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE getPatternOffset() const {
|
|
|
|
return _patternOffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE getMatchedLength() const {
|
|
|
|
return _matchedLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator > (const MatchedPatternFragment & other) const {
|
|
|
|
return (_matchedLength > other.getMatchedLength());
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SUFFIX_MARKER_TYPE _exampleId;
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE _exampleOffset;
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE _patternOffset;
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE _matchedLength;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|