/*------------------------------------------------------------------------------ * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team * * Distributable under the terms of either the Apache License (Version 2.0) or * the GNU Lesser General Public License, as specified in the COPYING file. ------------------------------------------------------------------------------*/ #ifndef _lucene_search_Explanation #define _lucene_search_Explanation #include "CLucene/util/VoidList.h" CL_NS_DEF(search) #define LUCENE_SEARCH_EXPLANATION_DESC_LEN 200 /** Expert: Describes the score computation for document and query. */ class CLUCENE_EXPORT Explanation { private: float_t value; // the value of this node TCHAR description[LUCENE_SEARCH_EXPLANATION_DESC_LEN]; // what it represents CL_NS(util)::CLArrayList >* details; // sub-explanations public: Explanation(); Explanation(float_t _value, const TCHAR* _description); virtual ~Explanation(); /** * Indicates whether or not this Explanation models a good match. * *

* By default, an Explanation represents a "match" if the value is positive. *

* @see #getValue */ virtual bool isMatch() const; /** The value assigned to this explanation node. */ float_t getValue() const; /** Sets the value assigned to this explanation node. */ void setValue(const float_t value); /** A description of this explanation node. */ const TCHAR* getDescription() const; /// * If the match statis is explicitly set (ie: not null) this method * uses it; otherwise it defers to the superclass. *

* @see #getMatch */ bool isMatch() const; Explanation* clone() const; protected: TCHAR* getSummary(); }; CL_NS_END #endif