org.egothor.core
Class QueryResponse

java.lang.Object
  extended by org.egothor.core.QueryResponse

public class QueryResponse
extends java.lang.Object

A QueryResponse is returned as a query return value. It contains the number of all hits and an enumeration of hits that is calculated as a response to user's query.

Author:
Leo Galambos

Constructor Summary
QueryResponse(int offset, long wouldBe, long positives, Sequence<Hit> e, Token[] queryTokens, int enum_len, Query adaptedQuery)
          Constructor for the QueryResponse object.
 
Method Summary
 Query getAdaptedQuery()
          Return the query which was finally solved in the system.
 long getHitsScanned()
          Return the number of hits that were really read and identified as positive hits.
 int getOffset()
          Return the offset of the first hit saved in this object.
 Sequence<Hit> getResult()
          Return an enumeration of Hits.
 int getResultLength()
          Gets the enumerationLength attribute of the QueryResponse object
 long getWouldBe()
          Return the number of hits that may be found for a query.
 Token[] queryTokens()
          Return an array of all tokens recognized in a query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResponse

public QueryResponse(int offset,
                     long wouldBe,
                     long positives,
                     Sequence<Hit> e,
                     Token[] queryTokens,
                     int enum_len,
                     Query adaptedQuery)
Constructor for the QueryResponse object.

Parameters:
offset - offset position of the first hit in this object
wouldBe - number of hits for a query (this value can be guessed)
positives - number of positive hits which were really read
e - Enumeration of Hits.
queryTokens - array of tokens of a query
enum_len - number of hits we collected
adaptedQuery - how the system adapted the original query
Method Detail

getAdaptedQuery

public Query getAdaptedQuery()
Return the query which was finally solved in the system.

Returns:
the adapted query

getResult

public Sequence<Hit> getResult()
Return an enumeration of Hits.

Returns:
an enumeration

getOffset

public int getOffset()
Return the offset of the first hit saved in this object.

Returns:
the offset

getResultLength

public int getResultLength()
Gets the enumerationLength attribute of the QueryResponse object

Returns:
The enumerationLength value

getWouldBe

public long getWouldBe()
Return the number of hits that may be found for a query. This value returns certain value if and only if the index was fully evaluated against a query. In other cases, it is only a guessed value.

Returns:
the number of hits

getHitsScanned

public long getHitsScanned()
Return the number of hits that were really read and identified as positive hits.

Returns:
the number of hits

queryTokens

public Token[] queryTokens()
Return an array of all tokens recognized in a query.

Returns:
Description of the Return Value