ir.vsr
Class DocumentReference

java.lang.Object
  extended by ir.vsr.DocumentReference

public class DocumentReference
extends java.lang.Object

A simple data structure for storing a reference to a document file that includes information on the length of its document vector. The goal is to have a lightweight object to store in an inverted index without having to store an entire Document object.


Field Summary
 java.io.File file
          The file where the referenced document is stored.
 double length
          The length of the corresponding Document vector.
 
Constructor Summary
DocumentReference(FileDocument doc)
          Create a reference to this document, initializing its length to 0
DocumentReference(java.io.File file, double length)
           
 
Method Summary
 Document getDocument(short docType, boolean stem)
          Get the full Document for this Document reference by recreating it with the given docType and stemming
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

public java.io.File file
The file where the referenced document is stored.


length

public double length
The length of the corresponding Document vector.

Constructor Detail

DocumentReference

public DocumentReference(java.io.File file,
                         double length)

DocumentReference

public DocumentReference(FileDocument doc)
Create a reference to this document, initializing its length to 0

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDocument

public Document getDocument(short docType,
                            boolean stem)
Get the full Document for this Document reference by recreating it with the given docType and stemming