Methods Summary |
---|
public void | close()Closes the enumeration to further activity, freeing resources.
actualEnum.close();
currentTerm = null;
actualEnum = null;
|
protected abstract float | difference()Equality measure on the term
|
public int | docFreq()Returns the docFreq of the current Term in the enumeration.
Initially invalid, valid after next() called for the first time.
if (actualEnum == null) return -1;
return actualEnum.docFreq();
|
protected abstract boolean | endEnum()Indiciates the end of the enumeration has been reached
|
public boolean | next()Increments the enumeration to the next element. True if one exists.
if (actualEnum == null) return false; // the actual enumerator is not initialized!
currentTerm = null;
while (currentTerm == null) {
if (endEnum()) return false;
if (actualEnum.next()) {
Term term = actualEnum.term();
if (termCompare(term)) {
currentTerm = term;
return true;
}
}
else return false;
}
currentTerm = null;
return false;
|
protected void | setEnum(org.apache.lucene.index.TermEnum actualEnum)
this.actualEnum = actualEnum;
// Find the first term that matches
Term term = actualEnum.term();
if (term != null && termCompare(term))
currentTerm = term;
else next();
|
public org.apache.lucene.index.Term | term()Returns the current Term in the enumeration.
Initially invalid, valid after next() called for the first time.
return currentTerm;
|
protected abstract boolean | termCompare(org.apache.lucene.index.Term term)Equality compare on the term
|