package hk.ust.comp4321.crawler;

import java.io.IOException;

import hk.ust.comp4321.database.IDGenerator;

/**
 * 
 * @author Alex Poon
 *
 */
public class Crawler
{

  // Constants and fields.
  // -------------------------------------------------------------------------
  
  private String url;
  private IDGenerator wordIdGenerator = new IDGenerator();
  private IDGenerator pageIdGenerator = new IDGenerator();
  
  // Constructors.
  // -------------------------------------------------------------------------
  
  public Crawler(String url)
  {
    this.url = url;
    
    // Extract 30 pages
    try
      {
        Extractor extractor = new Extractor(this.url, this.wordIdGenerator,
                                          this.pageIdGenerator);
      }
    catch (IOException ex)
      {
        System.err.println(ex.toString());
      }
  }
}

@@ -293,16 +293,63 @@
 ng url;%0A
+  private InvertedPageTable invertedPageTable;%0A
   privat
@@ -458,16 +458,84 @@
 ator();%0A
+  private const int TotalNumOfPage = 30;%0A  private int counter = 1;%0A
   %0A  // 
@@ -732,18 +732,67 @@
   %7B%0A    
+%09
   
+while(counter %3C= TotalNumOfPage)%0A    %09  %7B%0A    %09%09
   Extrac
@@ -918,16 +918,106 @@
 rator);%0A
+    %09%09  counter++;%0A    %09%09  this.url = invertedPageTable.getPageInfo(i).getUrl();%0A    %09  %7D%0A
       %7D%0A

Update Crawler.java