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.
19 namespace Lucene
.Net
.Index
22 /// <summary>Abstract class for enumerating terms.
23 /// <p>Term enumerations are always ordered by Term.compareTo(). Each term in
24 /// the enumeration is greater than all that precede it.
27 public abstract class TermEnum
29 /// <summary>Increments the enumeration to the next element. True if one exists.</summary>
30 public abstract bool Next();
32 /// <summary>Returns the current Term in the enumeration.</summary>
33 public abstract Term
Term();
35 /// <summary>Returns the docFreq of the current Term in the enumeration.</summary>
36 public abstract int DocFreq();
38 /// <summary>Closes the enumeration to further activity, freeing resources. </summary>
39 public abstract void Close();
41 // Term Vector support
43 /// <summary>Skips terms to the first beyond the current whose value is
44 /// greater or equal to <i>target</i>. <p>Returns true iff there is such
45 /// an entry. <p>Behaves as if written: <pre>
46 /// public boolean skipTo(Term target) {
50 /// } while (target > term());
54 /// Some implementations are considerably more efficient than that.
56 public virtual bool SkipTo(Term target
)
63 while (target
.CompareTo(Term()) > 0);