CSE494pgRank
Class LinkExtract

java.lang.Object
  |
  +--CSE494pgRank.LinkExtract

public class LinkExtract
extends java.lang.Object

Extract the Link Matrix that has been generated by LinkGen Provides functions outLinks and Citations. outLinks takes as input a filename and returns how many other pages in the stored repository it points to. Method citations accepts the fileName and returns a Vector containing fileNames of Files in the repository that cite the given file.


Constructor Summary
LinkExtract(java.lang.String rep, java.lang.String matrixFile)
          Constructor takes as input the Directory name where files are stored and Filename where the LinkMatrix generated by LinkGen is stored.
 
Method Summary
 java.util.ArrayList Citations(java.lang.String fileName)
          Returns a list of files/URLs that point to the given file/URL
 java.util.ArrayList Fileslist()
          Returns the list of all files in the repository
 java.util.ArrayList Links(java.lang.String fileName)
          Returns a list of files/URLs to which the given filename/URL points to
static void main(java.lang.String[] args)
          Demonstrates how the various files should be generated and prints the Citations and OutLinks for the first 6 files in the directory.
 int outLinks(java.lang.String fileName)
          Returns a count of files pointed to by the given FileName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkExtract

public LinkExtract(java.lang.String rep,
                   java.lang.String matrixFile)
Constructor takes as input the Directory name where files are stored and Filename where the LinkMatrix generated by LinkGen is stored. Loads the datastructures for use by other methods

Method Detail

Fileslist

public java.util.ArrayList Fileslist()
Returns the list of all files in the repository


outLinks

public int outLinks(java.lang.String fileName)
Returns a count of files pointed to by the given FileName


Links

public java.util.ArrayList Links(java.lang.String fileName)
Returns a list of files/URLs to which the given filename/URL points to


Citations

public java.util.ArrayList Citations(java.lang.String fileName)
Returns a list of files/URLs that point to the given file/URL


main

public static void main(java.lang.String[] args)
Demonstrates how the various files should be generated and prints the Citations and OutLinks for the first 6 files in the directory. This program should be invoked as : java LinkExtract "Directory_FilesStored" "LinkMatrixFile". Unless changed Link Matrix File is called "Hashedlinks"