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>TermDocs provides an interface for enumerating <document, frequency>
23 /// pairs for a term. <p> The document portion names each document containing
24 /// the term. Documents are indicated by number. The frequency portion gives
25 /// the number of times the term occurred in each document. <p> The pairs are
26 /// ordered by document number.
28 /// <seealso cref="IndexReader.TermDocs()">
31 public interface TermDocs
33 /// <summary>Sets this to the data for a term.
34 /// The enumeration is reset to the start of the data for this term.
38 /// <summary>Sets this to the data for the current term in a {@link TermEnum}.
39 /// This may be optimized in some implementations.
41 void Seek(TermEnum termEnum
);
43 /// <summary>Returns the current document number. <p> This is invalid until {@link
44 /// #Next()} is called for the first time.
48 /// <summary>Returns the frequency of the term within the current document. <p> This
49 /// is invalid until {@link #Next()} is called for the first time.
53 /// <summary>Moves to the next pair in the enumeration. <p> Returns true iff there is
54 /// such a next pair in the enumeration.
58 /// <summary>Attempts to read multiple entries from the enumeration, up to length of
59 /// <i>docs</i>. Document numbers are stored in <i>docs</i>, and term
60 /// frequencies are stored in <i>freqs</i>. The <i>freqs</i> array must be as
61 /// long as the <i>docs</i> array.
63 /// <p>Returns the number of entries read. Zero is only returned when the
64 /// stream has been exhausted.
66 int Read(int[] docs
, int[] freqs
);
68 /// <summary>Skips entries to the first beyond the current whose document number is
69 /// greater than or equal to <i>target</i>. <p>Returns true iff there is such
70 /// an entry. <p>Behaves as if written: <pre>
71 /// boolean skipTo(int target) {
75 /// } while (target > doc());
79 /// Some implementations are considerably more efficient than that.
81 bool SkipTo(int target
);
83 /// <summary>Frees associated resources. </summary>