org.apache.maven.index
Class IteratorSearchResponse

java.lang.Object
  extended by org.apache.maven.index.AbstractSearchResponse
      extended by org.apache.maven.index.IteratorSearchResponse
All Implemented Interfaces:
Closeable, Iterable<ArtifactInfo>

public class IteratorSearchResponse
extends AbstractSearchResponse
implements Iterable<ArtifactInfo>, Closeable

A Search Response for the "iterator-like" search request. The totalHitsCount reports total hits found on index, even if the set of ArtifactInfos are usually limited! On the flipside, the hitsCount is actually unknown, since this instance performs filtering on the fly, hence it does not know how many hits it will return ahead of time.

Author:
cstamas

Field Summary
static IteratorResultSet EMPTY_ITERATOR_RESULT_SET
           
static IteratorSearchResponse EMPTY_ITERATOR_SEARCH_RESPONSE
          Deprecated. Use empty(Query) instead.
static IteratorSearchResponse TOO_MANY_HITS_ITERATOR_SEARCH_RESPONSE
          Deprecated. Left here for backward compatibility, but since version 4.1.0 (see MINDEXER-14) there is NO notion of "hit limit" anymore.
 
Constructor Summary
IteratorSearchResponse(org.apache.lucene.search.Query query, int totalHits, IteratorResultSet results)
           
 
Method Summary
 void close()
          Frees any resource associated with this response.
static IteratorSearchResponse empty(org.apache.lucene.search.Query q)
           
 IteratorResultSet getResults()
           
 int getTotalProcessedArtifactInfoCount()
          A helper method delegating the call to the IteratorResultSet.
 IteratorResultSet iterator()
           
 
Methods inherited from class org.apache.maven.index.AbstractSearchResponse
getQuery, getReturnedHitsCount, getTotalHits, getTotalHitsCount, isHitLimitExceeded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ITERATOR_RESULT_SET

public static final IteratorResultSet EMPTY_ITERATOR_RESULT_SET

EMPTY_ITERATOR_SEARCH_RESPONSE

public static final IteratorSearchResponse EMPTY_ITERATOR_SEARCH_RESPONSE
Deprecated. Use empty(Query) instead.
Empty search response.


TOO_MANY_HITS_ITERATOR_SEARCH_RESPONSE

public static final IteratorSearchResponse TOO_MANY_HITS_ITERATOR_SEARCH_RESPONSE
Deprecated. Left here for backward compatibility, but since version 4.1.0 (see MINDEXER-14) there is NO notion of "hit limit" anymore.
Too many search response.

Constructor Detail

IteratorSearchResponse

public IteratorSearchResponse(org.apache.lucene.search.Query query,
                              int totalHits,
                              IteratorResultSet results)
Method Detail

getResults

public IteratorResultSet getResults()

iterator

public IteratorResultSet iterator()
Specified by:
iterator in interface Iterable<ArtifactInfo>

close

public void close()
           throws IOException
Description copied from class: AbstractSearchResponse
Frees any resource associated with this response. Should be called as last method on this response, when it's not used anymore.

Specified by:
close in interface Closeable
Overrides:
close in class AbstractSearchResponse
Throws:
IOException

getTotalProcessedArtifactInfoCount

public int getTotalProcessedArtifactInfoCount()
A helper method delegating the call to the IteratorResultSet.

Returns:

empty

public static final IteratorSearchResponse empty(org.apache.lucene.search.Query q)


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.