CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_search_Explanation 00008 #define _lucene_search_Explanation 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 CL_NS_DEF(search) 00015 00016 #define LUCENE_SEARCH_EXPLANATION_DESC_LEN 200 00017 class Explanation :LUCENE_BASE { 00018 private: 00019 float_t value; // the value of this node 00020 TCHAR description[LUCENE_SEARCH_EXPLANATION_DESC_LEN]; // what it represents 00021 CL_NS(util)::CLArrayList<Explanation*,CL_NS(util)::Deletor::Object<Explanation> > details; // sub-explanations 00022 00023 TCHAR* toString(int32_t depth); 00024 protected: 00025 Explanation(const Explanation& copy); 00026 public: 00027 Explanation(); 00028 ~Explanation(); 00029 00030 Explanation(float_t value, const TCHAR* description); 00031 void set(const Explanation& other); 00032 00033 Explanation* clone() const; 00034 00036 float_t getValue() const; 00037 00039 void setValue(float_t value); 00040 00042 const TCHAR* getDescription() const; 00043 00045 void setDescription(const TCHAR* description); 00046 00051 void getDetails(Explanation** ret); 00052 int getDetailsLength(); 00053 Explanation* getDetail(int i); 00054 00056 void addDetail(Explanation* detail); 00057 00059 TCHAR* toString(); 00060 00062 TCHAR* toHtml(); 00063 }; 00064 00065 CL_NS_END 00066 #endif