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_FilteredTermEnum_ 00008 #define _lucene_search_FilteredTermEnum_ 00009 00010 00011 CL_CLASS_DEF(index,Term) 00012 #include "CLucene/index/Terms.h" 00013 00014 CL_NS_DEF(search) 00015 //FilteredTermEnum is an abstract class for enumerating a subset of all terms. 00016 // 00017 //Term enumerations are always ordered by term->compareTo(). Each term in 00018 //the enumeration is greater than all that precede it. 00019 00020 class CLUCENE_EXPORT FilteredTermEnum: public CL_NS(index)::TermEnum { 00021 public: 00022 //Constructor 00023 FilteredTermEnum(); 00024 //Destructor 00025 virtual ~FilteredTermEnum(); 00026 00027 //Equality measure on the term 00028 virtual float_t difference() = 0; 00029 00030 //Returns the docFreq of the current Term in the enumeration. 00031 int32_t docFreq() const ; 00032 00033 //Increments the enumeration to the next element 00034 bool next() ; 00035 00036 //Returns a pointer to the current Term in the enumeration. 00037 CL_NS(index)::Term* term(); 00038 CL_NS(index)::Term* term(bool pointer); 00039 00040 //Closes the enumeration to further activity, freeing resources. 00041 void close(); 00042 00043 protected: 00044 //Equality compare on the term */ 00045 virtual bool termCompare(CL_NS(index)::Term* term) = 0; 00046 00047 //Indiciates the end of the enumeration has been reached 00048 virtual bool endEnum() = 0; 00049 00050 void setEnum(CL_NS(index)::TermEnum* actualEnum) ; 00051 00052 private: 00053 CL_NS(index)::Term* currentTerm; 00054 CL_NS(index)::TermEnum* actualEnum; 00055 00056 }; 00057 CL_NS_END 00058 #endif