comparison src/wikigraph/WikiPage.java @ 25:fbf0cf550b06 draft

fix ReadWikiLink.java
author one
date Thu, 30 Aug 2012 23:23:24 +0900
parents 21902773e530
children cfbab7d87188
comparison
equal deleted inserted replaced
24:71fe482aaf32 25:fbf0cf550b06
4 4
5 public class WikiPage { 5 public class WikiPage {
6 6
7 private String title; 7 private String title;
8 private long id; 8 private long id;
9 private long rank; 9 private Double rank;
10 private long outLink; 10 private long outLink;
11 private long inLink; 11 private long inLink;
12 12
13 WikiPage() { 13 WikiPage() {
14 this.title = null; 14 this.title = null;
15 this.id = -1; 15 this.id = -1;
16 this.rank = -1; 16 this.rank = -1.0;
17 this.outLink = 0; 17 this.outLink = 0;
18 this.inLink = 0; 18 this.inLink = 0;
19 } 19 }
20 20
21 WikiPage(Node node) { 21 WikiPage(Node node) {
22 this.title = (String) node.getProperty(LinkToNode.PAGE_TITLE); 22 this.title = (String) node.getProperty(LinkToNode.PAGE_TITLE);
23 this.id = node.getId(); 23 this.id = node.getId();
24 this.rank = (Long) node.getProperty(LinkToNode.PAGE_RANK); 24 this.rank = (Double)node.getProperty(LinkToNode.PAGE_RANK);
25 this.rank = 0.0;
25 this.outLink = 0; 26 this.outLink = 0;
26 this.inLink = 0; 27 this.inLink = 0;
27 } 28 }
28 29
29 WikiPage(String title, long id, long rank) { 30 WikiPage(String title, long id, Double rank) {
30 this.title = title; 31 this.title = title;
31 this.id = id; 32 this.id = id;
32 this.rank = rank; 33 this.rank = rank;
33 this.outLink = 0; 34 this.outLink = 0;
34 this.inLink = 0; 35 this.inLink = 0;
40 41
41 long getId() { 42 long getId() {
42 return id; 43 return id;
43 } 44 }
44 45
45 long getRank() { 46 double getRank() {
46 return rank; 47 return rank;
47 } 48 }
48 49
49 long getOutLink() { 50 long getOutLink() {
50 return outLink; 51 return outLink;
60 61
61 void setId(long id) { 62 void setId(long id) {
62 this.id = id; 63 this.id = id;
63 } 64 }
64 65
65 void setRank(long rank) { 66 void setRank(double rank) {
66 this.rank = rank; 67 this.rank = rank;
67 } 68 }
68 69
69 void setOutLink(long num) { 70 void setOutLink(long num) {
70 this.outLink = num; 71 this.outLink = num;