#ifndef MATCHED_PATTERN_FRAGMENT_HDR #define MATCHED_PATTERN_FRAGMENT_HDR #include "concordia/common/config.hpp" #include "concordia/interval.hpp" /*! Class representing matched pattern fragment in concordia search. This fragment can be seen as an interval of the pattern. This class holds information about: - where the pattern fragment was matched (example id and example offset) - where the fragment is located within the pattern (patternOffset, matchedLength) */ class MatchedPatternFragment : public Interval { public: /*! Constructor. \param exampleId id of the example where the pattern fragment was matched \param exampleOffset offset of the matched fragment in the example \param patternOffset offset of the matched fragment in the pattern \param matchedLength length of the matched pattern */ MatchedPatternFragment(const SUFFIX_MARKER_TYPE & exampleId, const SUFFIX_MARKER_TYPE & exampleOffset, const SUFFIX_MARKER_TYPE & patternOffset, const SUFFIX_MARKER_TYPE & matchedLength); /*! Destructor. */ virtual ~MatchedPatternFragment(); /*! Getter for example id. \returns example id */ SUFFIX_MARKER_TYPE getExampleId() const { return _exampleId; } /*! Getter for example offset. \returns example offset */ SUFFIX_MARKER_TYPE getExampleOffset() const { return _exampleOffset; } /*! Getter for pattern offset. \returns pattern offset */ SUFFIX_MARKER_TYPE getPatternOffset() const { return _patternOffset; } /*! Getter for matched length. \returns matched fragment length */ SUFFIX_MARKER_TYPE getMatchedLength() const { return _matchedLength; } /*! Operator for comparing fragments by their length. \returns true if current pattern is longer than the other */ 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