diff src/wikigraph/LinkToNode.java @ 23:21902773e530 draft

fix ReadWikiLink.java
author one
date Tue, 28 Aug 2012 14:38:13 +0900
parents f9ef906676eb
children 71fe482aaf32
line wrap: on
line diff
--- a/src/wikigraph/LinkToNode.java	Tue Aug 28 14:04:46 2012 +0900
+++ b/src/wikigraph/LinkToNode.java	Tue Aug 28 14:38:13 2012 +0900
@@ -24,10 +24,11 @@
 
 	public final static String PAGE_TITLE = "page_title";
 	public final static String PAGE_RANK = "page_rank";
-//	private HashSet<String> names = new HashSet<String>();
 	private HashMap<String,Long> pageIdTable = new HashMap<String,Long>();
 	private HashMap<String,Long> pageRankTable = new HashMap<String,Long>();
 	
+	private HashMap<String,WikiPage> wikiPageHash = new HashMap<String,WikiPage>();
+
 	public enum RelTypes implements RelationshipType {
 		HAS_LINK
 	}
@@ -117,6 +118,18 @@
 		return AllNodeNumber;
 	}
 	
+	long searchAllNodes() {
+		long AllNodeNumber = 0;
+		for (Node n: graphOpe.getAllNodes()) {
+			if (n.hasProperty(PAGE_TITLE)) {
+				WikiPage wiki = new WikiPage(n);
+				wikiPageHash.put((String)n.getProperty(PAGE_TITLE), wiki);
+				AllNodeNumber++;
+			}
+		}
+		return AllNodeNumber;
+	}
+	
 	HashMap<String,Long> getPageIdTable() {
 		return pageIdTable;
 	}
@@ -125,6 +138,10 @@
 		return pageRankTable;
 	}	
 	
+	HashMap<String,WikiPage> getWikiPageHash() {
+		return wikiPageHash;
+	}
+	
 	public void printAllNodes() {
 		for (Node n: graphOpe.getAllNodes()) {
 			System.out.println("ID="+ n.getId());