Package org.dlese.dpc.index
Class TermDocCount
java.lang.Object
org.dlese.dpc.index.TermDocCount
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a feature to the Field attribute of the TermDocCount objectvoidaddToDocCount(int add) Adds a feature to the ToDocCount attribute of the TermDocCount objectvoidaddToTermCount(int add) Adds a feature to the ToTermCount attribute of the TermDocCount objectintCompares two TermDocCount by the term count.intGets the docCount attribute of the TermDocCount objectGets the fields attribute of the TermDocCount objectintGets the termCount attribute of the TermDocCount object
-
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
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
Gets the fields attribute of the TermDocCount object- Returns:
- The fields value
-
compareTo
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.
-