|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.TermEnum
public abstract class TermEnum
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.
Constructor Summary | |
---|---|
TermEnum()
|
Method Summary | |
---|---|
abstract void |
close()
Closes the enumeration to further activity, freeing resources. |
abstract int |
docFreq()
Returns the docFreq of the current Term in the enumeration. |
abstract boolean |
next()
Increments the enumeration to the next element. |
boolean |
skipTo(Term target)
Deprecated. This method is not performant and will be removed in Lucene 3.0. Use IndexReader.terms(Term) to create a new TermEnum positioned at a
given term. |
abstract Term |
term()
Returns the current Term in the enumeration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TermEnum()
Method Detail |
---|
public abstract boolean next() throws IOException
IOException
public abstract Term term()
public abstract int docFreq()
public abstract void close() throws IOException
IOException
public boolean skipTo(Term target) throws IOException
IndexReader.terms(Term)
to create a new TermEnum positioned at a
given term.
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 *could* be considerably more efficient than a linear scan. Check the implementation to be sure.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |