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