com.sun.labs.minion
Class Posting

java.lang.Object
  extended by com.sun.labs.minion.Posting
All Implemented Interfaces:
java.io.Serializable

public class Posting
extends java.lang.Object
implements java.io.Serializable

A single posting from a document, composed of a term and the frequency of that term in the document.

See Also:
Document.getPostings(java.lang.String), Serialized Form

Field Summary
protected  int freq
          The frequency of the term.
protected  java.lang.String term
          The term represented by this posting.
 
Constructor Summary
Posting()
           
Posting(java.lang.String term, int freq)
          Creates a posting for a given term and frequency.
 
Method Summary
 int getFreq()
          Gets the frequency of this term in this document.
 java.lang.String getTerm()
          Gets the term associated with this posting.
 java.lang.String toString()
          Generates a string representation of this posting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

term

protected java.lang.String term
The term represented by this posting.


freq

protected int freq
The frequency of the term.

Constructor Detail

Posting

public Posting()

Posting

public Posting(java.lang.String term,
               int freq)
Creates a posting for a given term and frequency.

Parameters:
term - the term represented by this posting. Spaces will be trimmed from the beginning and end of this term
freq - the frequency of the term in the index.
Method Detail

getTerm

public java.lang.String getTerm()
Gets the term associated with this posting.

Returns:
the term associated with this posting

getFreq

public int getFreq()
Gets the frequency of this term in this document.

Returns:
the frequency of this term in this document.

toString

public java.lang.String toString()
Generates a string representation of this posting

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the posting