00001 /* -*- C++ -*- 00002 00003 textIR - A fast text document retrieval engine 00004 00005 Copyright (C) 2005-2009 Laurence Park 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 00020 File information: 00021 $Header: /home/staff/lapark/cvsroot/web_search/textIR/src/URL.h,v 1.4 2009/10/08 06:41:30 lapark Exp $ 00022 */ 00023 00024 #ifndef URL_H 00025 #define URL_H 00026 00027 #include "FileIO.h" 00028 #include "Element.h" 00029 #include "ElementList.tcc" 00030 00031 00050 class URL : public Element { 00051 public: 00052 00054 URL(char *word, int wordNumber, int totalCount = 0, 00055 int documentCount = 0, FILE_POS_TYPE filePosition = 0, int linkCount = 0, 00056 int uniqueLinkCount = 0); 00057 00059 URL(FileIO *file); 00060 ~URL(void); 00061 00063 void incrementTotalCount(void); 00064 00066 void incrementDocumentCount(void); 00067 00069 void assignLinkCount(int links); 00070 00072 void assignUniqueLinkCount(int links); 00073 00075 int linkCount(void); 00076 00078 int uniqueLinkCount(void); 00079 00081 int documentCount(void); 00082 00084 int totalCount(void); 00085 00087 void purge(FileIO *file); 00088 00090 void salvage(FileIO *file); 00091 00093 void operator= (const URL &url); 00094 00095 friend class CompareElements<URL>; 00096 friend class ElementList<URL>; 00097 00098 private: 00099 // links found with this document 00100 int _linkCount; 00101 // appearing documents containing links to this url 00102 int _documentCount; 00103 // appearing links to this url 00104 int _totalCount; 00105 // unique links within the document 00106 int _uniqueLinkCount; 00107 }; 00108 00109 00110 00111 #endif