# ****************************************************
# Name des Moduls: mod_DocumentObjects
# Name des Projekts: TaxoSearch
#
# Autor(en):
#        Thorsten Beinhorn, Vesna Cvoro,
#        Khaled Dhaoui und Christian Pretzsch 
#
# Aufgaben des Moduls: siehe Code Dokumentation TaxoSearch
# 
#
# Datum der letzten Aenderung: 26.11.2003
# ****************************************************


#!/usr/bin/python
 
#Begin of class DocumentObject
class DocumentObject:
    def __init__(self):
        self.URL=""
        self.Title=""
        self.Page=""
        self.PageContent=""
        self.dicDocumentVector={}
        self.numWordCount=0
        self.numDocumentRating=0.0
#End of class DocumentObject

#Begin of class DocumentCollection
#the DocumentCollection stores all retrieved WebSites as DocumentObjects in a dictionary
class DocumentCollection:
    def __init__(self):
        self.dicDocumentCollection={}

    def AddDocument(self, PageURL, Title):
        #add new document to cowllection
        tmpDocument=DocumentObject()
        tmpDocument.URL=PageURL
        tmpDocument.Title=Title

        self.dicDocumentCollection[PageURL]=tmpDocument

    def UpdateDocument(self, DocumentObject):
        self.dicDocumentCollection[DocumentObject.URL]=DocumentObject
        
    def DeleteDocument(self, URL):
    	del self.dicDocumentCollection[URL]

    def UpdateDocumentPage(self, URL, Page):
        self.dicDocumentCollection[URL].Page=Page
#End of class DocumentCollection



