Class TermDocCount

java.lang.Object
org.dlese.dpc.index.TermDocCount

public class TermDocCount extends Object
A TermDocCount is returned by SimpleLuceneIndex.getTermAndDocCounts(String[]) and contains the term count, the total number of documents containing the term and a list of fields in which the term appears.
Author:
John Weatherley
  • Constructor Details

    • TermDocCount

      public TermDocCount()
  • Method Details

    • addToTermCount

      public void addToTermCount(int add)
      Adds a feature to the ToTermCount attribute of the TermDocCount object
      Parameters:
      add - The feature to be added to the ToTermCount attribute
    • addToDocCount

      public void addToDocCount(int add)
      Adds a feature to the ToDocCount attribute of the TermDocCount object
      Parameters:
      add - The feature to be added to the ToDocCount attribute
    • addField

      public void addField(String field)
      Adds a feature to the Field attribute of the TermDocCount object
      Parameters:
      field - The feature to be added to the Field attribute
    • getTermCount

      public int getTermCount()
      Gets the termCount attribute of the TermDocCount object
      Returns:
      The termCount value
    • getDocCount

      public int getDocCount()
      Gets the docCount attribute of the TermDocCount object
      Returns:
      The docCount value
    • getFields

      public ArrayList getFields()
      Gets the fields attribute of the TermDocCount object
      Returns:
      The fields value
    • compareTo

      public int compareTo(Object o) throws ClassCastException
      Compares two TermDocCount by the term count. Collections.sort() or Arrays.sort() can thus be used to sort a list of TermDocCount by Name.
      Parameters:
      o - The TermDocCount to compare
      Returns:
      Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Throws:
      ClassCastException - If the object passed in is not a proper.