edu.umd.cloud9.collection
Interface DocumentForwardIndex<T extends Indexable>

Type Parameters:
T - type of document
All Known Implementing Classes:
Aquaint2ForwardIndex, ClueWarcForwardIndex, IndexableAnchorTextForwardIndex, TrecForwardIndex, WikipediaForwardIndex

public interface DocumentForwardIndex<T extends Indexable>

Interface for a document forward index.

Author:
Jimmy Lin

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.
 T getDocument(int docno)
          Fetches the document for a given docno.
 T 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.
 

Method Detail

getDocno

int getDocno(String docid)
Returns the docno, given the docid.

Returns:
docno for the docid

getDocid

String getDocid(int docno)
Returns the docid, given the docno.

Returns:
docid for the docno

getDocument

T getDocument(int docno)
Fetches the document for a given docno.

Returns:
the document object

getDocument

T getDocument(String docid)
Fetches the document for a given docid.

Returns:
the document object

getFirstDocno

int getFirstDocno()
Returns the first docno in the collection.

Returns:
the first docno in the collection

getLastDocno

int getLastDocno()
Returns the last docno in the collection.

Returns:
the last docno in the collection

loadIndex

void loadIndex(Path index,
               Path mapping,
               FileSystem fs)
               throws IOException
Loads the index.

Parameters:
index - path of the index data
mapping - path of the docno/docid mapping data
fs - reference to the FileSystem
Throws:
IOException

getCollectionPath

String getCollectionPath()
Returns the base path of the collection.

Returns:
base path of the collection