org.apache.lucene.search

Class HitIterator

public class HitIterator extends Object implements Iterator

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

Author: Jeremy Rayner

Method Summary
booleanhasNext()
intlength()
Returns the total number of hits.
Objectnext()
Returns a {@link Hit} instance representing the next hit in {@link Hits}.
voidremove()
Unsupported operation.

Method Detail

hasNext

public boolean hasNext()

Returns: true if current hit is less than the total number of {@link Hits}.

length

public int length()
Returns the total number of hits.

next

public Object next()
Returns a {@link Hit} instance representing the next hit in {@link Hits}.

Returns: Next {@link Hit}.

remove

public void remove()
Unsupported operation.

Throws: UnsupportedOperationException

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