@@ -0,0 +1,1927 @@
+package hk.ust.comp4321.main%0A%0Aimport java.io.PrintStream;%0A%0Apublic class Main%0A%7B%0A%0A  // Class methods.%0A  // -------------------------------------------------------------------------%0A%0A  public static void main(String ars%5B%5D)%0A  %7B%0A    try%0A      %7B%0A        // Setup output file%0A        PrintStream out = new PrintStream(new FileOutputStream(%0A                                      %22spider_result.txt%22));%0A    %0A        // Extract pages%0A        Crawler clawler = new Crawler(%22http://www.cse.ust.hk%22);%0A%0A        // Output results%0A        InvertedPageTable invertedPageTable = InvertedPageTable.getTable();%0A        ForwardIndexTable forwardIndexTable = forwardIndexTable.getTable();%0A        InvertedWordTable InvertedWordTable = InvertedWordTable.getTable();%0A        FastIterator iter = invertedPageTable.keys();%0A        int pageId;%0A        PageInfo pageInfo = null;%0A        while((pageId = (int)iter.next()) != null)%0A          %7B%0A            // Display an individual page%0A            pageInfo = invertedPageTable.getPageInfo (pageId);%0A            out.println(%22Title: %22 + pageInfo.getTitle());%0A            out.println(%22URL: %22 + pageInfo.getUrl());%0A            out.printf(%22%251$s %252$tB %252$td, %252$tY%22 ,%0A                              %22Last modification date: %22, pageInfo.getTitle());%0A            out.println(%22Page size: %22 + pageInfo.getUrl() + %22byte%22);%0A            List%3CDocInfo%3E docInfoList = forwardIndexTable.getDocInfoList(pageId);%0A            for(int i = 0; i %3C docInfoList.size(); i++)%0A              %7B %0A                String word = InvertedWordTable.getWord %0A                              (docInfoList.get (i).getId());%0A                out.print( + docInfoList.get (i).getFrequency() + %22; %22);%0A              %7D%0A            out.println(%22%22);%0A            //TODO: Child link%0A          %7D%0A%0A        // Close file%0A        out.close();%0A      %7D%0A      catch (FileNotFoundException ex)%0A        %7B%0A          System.err.println(ex.toString());%0A        %7D%0A  %7D%0A%7D%0A

Add output generating