- Cosmetics and Javadocs.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149974 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Otis Gospodnetic 2003-04-16 04:22:38 +00:00
parent 9e4c0f3925
commit d40c5493a6
1 changed files with 11 additions and 3 deletions

View File

@ -75,7 +75,11 @@ public class WildcardTermEnum extends FilteredTermEnum {
boolean fieldMatch = false;
boolean endEnum = false;
/** Creates new WildcardTermEnum */
/**
* Creates a new <code>WildcardTermEnum</code>. Passing in a
* {@link org.apache.lucene.index.Term} that does not contain a
* <code>WILDCARD_CHAR</code> will cause an exception to be thrown.
*/
public WildcardTermEnum(IndexReader reader, Term term) throws IOException {
super(reader, term);
searchTerm = term;
@ -85,8 +89,12 @@ public class WildcardTermEnum extends FilteredTermEnum {
int sidx = text.indexOf(WILDCARD_STRING);
int cidx = text.indexOf(WILDCARD_CHAR);
int idx = sidx;
if (idx == -1) idx = cidx;
else if (cidx >= 0) idx = Math.min(idx, cidx);
if (idx == -1) {
idx = cidx;
}
else if (cidx >= 0) {
idx = Math.min(idx, cidx);
}
pre = searchTerm.text().substring(0,idx);
preLen = pre.length();