2 * Copyright 2005 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
.Search
22 /// <summary> An iterator over {@link Hits} that provides lazy fetching of each document.
23 /// {@link Hits#Iterator()} returns an instance of this class. Calls to {@link #next()}
24 /// return a {@link Hit} instance.
27 /// <author> Jeremy Rayner
29 public class HitIterator
: System
.Collections
.IEnumerator
31 /// <summary> Returns a {@link Hit} instance representing the next hit in {@link Hits}.
34 /// <returns> Next {@link Hit}.
36 public virtual System
.Object Current
40 if (hitNumber
== hits
.Length())
41 throw new System
.ArgumentOutOfRangeException();
43 System
.Object next
= new Hit(hits
, hitNumber
);
50 private int hitNumber
= 0;
52 /// <summary> Constructed from {@link Hits#Iterator()}.</summary>
53 internal HitIterator(Hits hits
)
58 /// <returns> true if current hit is less than the total number of {@link Hits}.
60 public virtual bool MoveNext()
62 return hitNumber
< hits
.Length();
65 /// <summary> Unsupported operation.
68 /// <throws> UnsupportedOperationException </throws>
69 public virtual void Remove()
71 throw new System
.NotSupportedException();
74 /// <summary> Returns the total number of hits.</summary>
75 public virtual int Length()
79 //UPGRADE_TODO: The following method was automatically generated and it must be implemented in order to preserve the class logic. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1232'"
80 virtual public void Reset()