2 * Copyright 2004 The Apache Software Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 namespace Lucene
.Net
.Index
20 /// <summary>Abstract class for enumerating terms.
21 /// <p>Term enumerations are always ordered by Term.compareTo(). Each term in
22 /// the enumeration is greater than all that precede it.
25 public abstract class TermEnum
27 /// <summary>Increments the enumeration to the next element. True if one exists.</summary>
28 public abstract bool Next();
30 /// <summary>Returns the current Term in the enumeration.</summary>
31 public abstract Term
Term();
33 /// <summary>Returns the docFreq of the current Term in the enumeration.</summary>
34 public abstract int DocFreq();
36 /// <summary>Closes the enumeration to further activity, freeing resources. </summary>
37 public abstract void Close();
39 // Term Vector support
41 /// <summary>Skips terms to the first beyond the current whose value is
42 /// greater or equal to <i>target</i>. <p>Returns true iff there is such
43 /// an entry. <p>Behaves as if written: <pre>
44 /// public boolean skipTo(Term target) {
48 /// } while (target > term());
52 /// Some implementations are considerably more efficient than that.
54 public virtual bool SkipTo(Term target
)
61 while (target
.CompareTo(Term()) > 0);