-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpage.h
More file actions
76 lines (63 loc) · 1.19 KB
/
webpage.h
File metadata and controls
76 lines (63 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <string>
#include <set>
#include <fstream>
class WebPage {
public:
/**
* Default constructor
*/
WebPage(std::string n);
/**
* Destructor
*/
~WebPage();
/**
* Adds word to words set
*/
void addWord(const std::string &word);
/**
* Adds outgoing link to outgoing set
*/
void addOutgoingLink(const std::string &link);
/**
* Adds incoming link to incoming set
*/
void addIncomingLink(const std::string &link);
/**
* Prints outgoing links
*/
void printOutgoingLinks(std::ofstream &output);
/**
* Prints incoming links
*/
void printIncomingLinks(std::ofstream &output);
/**
* Returns filename of WebPage
*/
std::string getName() const;
/**
* Returns outgoing links of WebPage
*/
std::set<std::string> getOutgoingLinks() const;
/**
* Returns incoming links of WebPage
*/
std::set<std::string> getIncomingLinks() const;
/**
* Returns page rank of WebPage
*/
double getPageRank() const;
/**
* Sets page rank of WebPage
*/
void setPageRank(double rank);
private:
/**
* Data members
*/
std::string name;
std::set<std::string> words;
std::set<std::string> outgoing;
std::set<std::string> incoming;
double pageRank;
};