edu.umd.cloud9.collection.aquaint2
Class Aquaint2ForwardIndex

java.lang.Object
  extended by edu.umd.cloud9.collection.aquaint2.Aquaint2ForwardIndex
All Implemented Interfaces:
DocumentForwardIndex<Aquaint2Document>

public class Aquaint2ForwardIndex
extends Object
implements DocumentForwardIndex<Aquaint2Document>

Object representing a document forward index for AQUAINT2 collections.

Author:
Jimmy Lin

Constructor Summary
Aquaint2ForwardIndex()
           
 
Method Summary
 String getCollectionPath()
          Returns the base path of the collection.
 String getDocid(int docno)
          Returns the docid, given the docno.
 int getDocno(String docid)
          Returns the docno, given the docid.
 Aquaint2Document getDocument(int docno)
          Fetches the document for a given docno.
 Aquaint2Document getDocument(String docid)
          Fetches the document for a given docid.
 int getFirstDocno()
          Returns the first docno in the collection.
 int getLastDocno()
          Returns the last docno in the collection.
 void loadIndex(Path index, Path mapping, FileSystem fs)
          Loads the index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aquaint2ForwardIndex

public Aquaint2ForwardIndex()
Method Detail

getDocno

public int getDocno(String docid)
Description copied from interface: DocumentForwardIndex
Returns the docno, given the docid.

Specified by:
getDocno in interface DocumentForwardIndex<Aquaint2Document>
Returns:
docno for the docid

getDocid

public String getDocid(int docno)
Description copied from interface: DocumentForwardIndex
Returns the docid, given the docno.

Specified by:
getDocid in interface DocumentForwardIndex<Aquaint2Document>
Returns:
docid for the docno

getLastDocno

public int getLastDocno()
Description copied from interface: DocumentForwardIndex
Returns the last docno in the collection.

Specified by:
getLastDocno in interface DocumentForwardIndex<Aquaint2Document>
Returns:
the last docno in the collection

getFirstDocno

public int getFirstDocno()
Description copied from interface: DocumentForwardIndex
Returns the first docno in the collection.

Specified by:
getFirstDocno in interface DocumentForwardIndex<Aquaint2Document>
Returns:
the first docno in the collection

getCollectionPath

public String getCollectionPath()
Description copied from interface: DocumentForwardIndex
Returns the base path of the collection.

Specified by:
getCollectionPath in interface DocumentForwardIndex<Aquaint2Document>
Returns:
base path of the collection

getDocument

public Aquaint2Document getDocument(String docid)
Description copied from interface: DocumentForwardIndex
Fetches the document for a given docid.

Specified by:
getDocument in interface DocumentForwardIndex<Aquaint2Document>
Returns:
the document object

getDocument

public Aquaint2Document getDocument(int docno)
Description copied from interface: DocumentForwardIndex
Fetches the document for a given docno.

Specified by:
getDocument in interface DocumentForwardIndex<Aquaint2Document>
Returns:
the document object

loadIndex

public void loadIndex(Path index,
                      Path mapping,
                      FileSystem fs)
               throws IOException
Description copied from interface: DocumentForwardIndex
Loads the index.

Specified by:
loadIndex in interface DocumentForwardIndex<Aquaint2Document>
Parameters:
index - path of the index data
mapping - path of the docno/docid mapping data
fs - reference to the FileSystem
Throws:
IOException