## org.apache.lucene.search
Class HitIterator

    java.lang.Object
      org.apache.lucene.search.HitIterator

All Implemented Interfaces:
  java.util.Iterator

Deprecated. Use `TopScoreDocCollector` and `TopDocs` instead. Hits will be removed in Lucene 3.0.

    public class HitIterator

extends java.lang.Object
implements java.util.Iterator

An iterator over `Hits` that provides lazy fetching of each document. `Hits.iterator()` returns an instance of this class. Calls to `next()` return a `Hit` instance.

Method Summary
`boolean` `hasNext()` Deprecated.
`int` `length()` Deprecated. Returns the total number of hits.
`java.lang.Object` `next()` Deprecated. Returns a `Hit` instance representing the next hit in `Hits`.
`void` `remove()` Deprecated. Unsupported operation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### hasNext

    public boolean hasNext()

  Deprecated.
  Specified by:
    `hasNext` in interface `java.util.Iterator`
  Returns:
    true if current hit is less than the total number of `Hits`.

### next

    public java.lang.Object next()

  Deprecated.
  Returns a `Hit` instance representing the next hit in `Hits`.

  Specified by:
    `next` in interface `java.util.Iterator`
  Returns:
    Next `Hit`.

### remove

    public void remove()

  Deprecated.
  Unsupported operation.

  Specified by:
    `remove` in interface `java.util.Iterator`
  Throws:
    `java.lang.UnsupportedOperationException`

### length

    public int length()

  Deprecated.
  Returns the total number of hits.

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.