edu.umd.cloud9.collection.line
Class TextDocument

java.lang.Object
  extended by edu.umd.cloud9.collection.Indexable
      extended by edu.umd.cloud9.collection.line.TextDocument
All Implemented Interfaces:
Writable

public class TextDocument
extends Indexable

Object representing a simple document. Document is encoded as docid followed by tab followed by document contents. Document contents cannot contain embedded tabs or newlines. The entire document is encoded on a single line.

Author:
Jimmy Lin

Constructor Summary
TextDocument()
          Creates an empty TrecDocument object.
 
Method Summary
 String getContent()
          Returns the content of the document.
 String getDocid()
          Returns the globally-unique String identifier of the document within the collection.
static void readDocument(TextDocument doc, String s)
           
 void readFields(DataInput in)
          Serializes this object.
 void write(DataOutput out)
          Deserializes this object.
 
Methods inherited from class edu.umd.cloud9.collection.Indexable
getDisplayContent, getDisplayContentType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextDocument

public TextDocument()
Creates an empty TrecDocument object.

Method Detail

write

public void write(DataOutput out)
           throws IOException
Deserializes this object.

Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Serializes this object.

Throws:
IOException

getDocid

public String getDocid()
Description copied from class: Indexable
Returns the globally-unique String identifier of the document within the collection.

Specified by:
getDocid in class Indexable

getContent

public String getContent()
Description copied from class: Indexable
Returns the content of the document.

Specified by:
getContent in class Indexable

readDocument

public static void readDocument(TextDocument doc,
                                String s)