java.lang.Object
es.uam.eps.ir.relison.content.index.structure.Posting
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Posting>
Direct Known Subclasses:
PositionalPosting

public class Posting
extends java.lang.Object
implements java.lang.Comparable<Posting>, java.io.Serializable
Posting in an index.
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int docID
    Document identifier for the posting.
    (package private) long freq
    Frequency of the term associated to the posting in the document.
  • Constructor Summary

    Constructors 
    Constructor Description
    Posting​(int id, long f)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    int compareTo​(Posting p)
    Compares two postings (by docId)
    int getDocID()
    Obtains the document identifier.
    long getFreq()
    Obtains the frequency of the term in the document.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • freq

      long freq
      Frequency of the term associated to the posting in the document.
    • docID

      private int docID
      Document identifier for the posting.
  • Constructor Details

    • Posting

      public Posting​(int id, long f)
      Constructor.
      Parameters:
      id - document identifier.
      f - frequency of the term in the document.
  • Method Details

    • getDocID

      public int getDocID()
      Obtains the document identifier.
      Returns:
      the identifier.
    • getFreq

      public long getFreq()
      Obtains the frequency of the term in the document.
      Returns:
      the frequency of the term in the document.
    • compareTo

      public int compareTo​(Posting p)
      Compares two postings (by docId)
      Specified by:
      compareTo in interface java.lang.Comparable<Posting>
      Parameters:
      p - the posting
      Returns:
      this.docId - p.getDocId