DLESE Tools
v1.6.0

org.dlese.dpc.index
Class TermDocCount

java.lang.Object
  extended by 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 Summary
TermDocCount()
           
 
Method Summary
 void addField(String field)
          Adds a feature to the Field attribute of the TermDocCount object
 void addToDocCount(int add)
          Adds a feature to the ToDocCount attribute of the TermDocCount object
 void addToTermCount(int add)
          Adds a feature to the ToTermCount attribute of the TermDocCount object
 int compareTo(Object o)
          Compares two TermDocCount by the term count.
 int getDocCount()
          Gets the docCount attribute of the TermDocCount object
 ArrayList getFields()
          Gets the fields attribute of the TermDocCount object
 int getTermCount()
          Gets the termCount attribute of the TermDocCount object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermDocCount

public TermDocCount()
Method Detail

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.

DLESE Tools
v1.6.0