FileDocCategorySizeDatePackage
TermEnum.javaAPI DocApache Lucene 2.1.02181Wed Feb 14 10:46:40 GMT 2007org.apache.lucene.index

TermEnum

public abstract class TermEnum extends Object
Abstract class for enumerating terms.

Term enumerations are always ordered by Term.compareTo(). Each term in the enumeration is greater than all that precede it.

Fields Summary
Constructors Summary
Methods Summary
public abstract voidclose()
Closes the enumeration to further activity, freeing resources.

public abstract intdocFreq()
Returns the docFreq of the current Term in the enumeration.

public abstract booleannext()
Increments the enumeration to the next element. True if one exists.

public booleanskipTo(org.apache.lucene.index.Term target)
Skips terms to the first beyond the current whose value is greater or equal to target.

Returns true iff there is such an entry.

Behaves as if written:

public boolean skipTo(Term target) {
do {
if (!next())
return false;
} while (target > term());
return true;
}
Some implementations are considerably more efficient than that.

     do {
        if (!next())
  	        return false;
     } while (target.compareTo(term()) > 0);
     return true;
  
public abstract org.apache.lucene.index.Termterm()
Returns the current Term in the enumeration.