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

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `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`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### 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-2016 Apache Software Foundation. All Rights Reserved.