00001 /*========================================================================== 00002 * Copyright (c) 2001 Carnegie Mellon University. All Rights Reserved. 00003 * 00004 * Use of the Lemur Toolkit for Language Modeling and Information Retrieval 00005 * is subject to the terms of the software license set forth in the LICENSE 00006 * file included with this software, and also available at 00007 * http://www.cs.cmu.edu/~lemur/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 00012 00013 #include "TermInfoList.hpp" 00014 00016 00017 class BasicTermInfoList : public TermInfoList { 00018 public: 00019 BasicTermInfoList(int *tmpWordArray, int size); 00020 00021 virtual ~BasicTermInfoList() {} 00022 virtual void startIteration() const{ 00023 it = 0; 00024 } 00025 00026 virtual bool hasMore() const{ return (it<sz); } 00027 00028 virtual TermInfo *nextEntry() const; 00029 00030 protected: 00031 // Helper functions for iterator, subclasses should override 00033 virtual TermInfo* getElement(TermInfo* elem, POS_T position) const; 00035 virtual POS_T beginPosition() const { return (POS_T) 0; } 00037 virtual POS_T endPosition() const { return (POS_T) sz; } 00039 virtual POS_T nextPosition(POS_T position) const; 00040 00041 private: 00042 int sz; 00043 mutable int it; 00044 int *tmpwarr; 00045 }; 00046