LUCENE-1680: make prefix Term accessible

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@783370 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-06-10 14:39:12 +00:00
parent e3c3d443a8
commit 2c351e832e
1 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,7 @@ import org.apache.lucene.index.Term;
*/
public class PrefixTermEnum extends FilteredTermEnum {
private Term prefix;
private final Term prefix;
private boolean endEnum = false;
public PrefixTermEnum(IndexReader reader, Term prefix) throws IOException {
@ -31,6 +31,10 @@ public class PrefixTermEnum extends FilteredTermEnum {
protected boolean endEnum() {
return endEnum;
}
protected Term getPrefixTerm() {
return prefix;
}
protected boolean termCompare(Term term) {
if (term.field() == prefix.field() && term.text().startsWith(prefix.text())) {